diff options
author | Roland McGrath <roland@redhat.com> | 2003-11-14 02:54:03 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2003-11-14 02:54:03 +0000 |
commit | 2843a4e1d2fca851be6e47e7ff2413b45903ac9a (patch) | |
tree | 74275d627444a6c5ba9b04b7c52338bfbfc02623 /io.c | |
parent | f25ef3916f41f9a6187c66c2053f0a1591b39812 (diff) | |
download | strace-2843a4e1d2fca851be6e47e7ff2413b45903ac9a.tar.gz strace-2843a4e1d2fca851be6e47e7ff2413b45903ac9a.tar.bz2 strace-2843a4e1d2fca851be6e47e7ff2413b45903ac9a.tar.xz |
2003-09-06 Dmitry V. Levin <ldv@altlinux.org>
* defs.h (ioctl_lookup): Prototype change.
* ioctl.c (ioctl_next_match): New function.
* defs.h: Declare it.
* io.c (sys_ioctl): Use it, to display all possible ioctl names
when there's more than one match.
* ioctl.c (ioctl_lookup): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
Patch from Solar Designer <solar@openwall.com>.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -353,14 +353,16 @@ int sys_ioctl(tcp) struct tcb *tcp; { - char *symbol; + struct ioctlent *iop; if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); - symbol = ioctl_lookup(tcp->u_arg[1]); - if (symbol) - tprintf("%s", symbol); - else + iop = ioctl_lookup(tcp->u_arg[1]); + if (iop) { + tprintf("%s", iop->symbol); + while ((iop = ioctl_next_match(iop))) + tprintf(" or %s", iop->symbol); + } else tprintf("%#lx", tcp->u_arg[1]); ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); } |