summaryrefslogtreecommitdiff
path: root/stream.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2003-11-14 02:54:03 +0000
committerRoland McGrath <roland@redhat.com>2003-11-14 02:54:03 +0000
commit2843a4e1d2fca851be6e47e7ff2413b45903ac9a (patch)
tree74275d627444a6c5ba9b04b7c52338bfbfc02623 /stream.c
parentf25ef3916f41f9a6187c66c2053f0a1591b39812 (diff)
downloadstrace-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 'stream.c')
-rw-r--r--stream.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/stream.c b/stream.c
index 3dac282..21deb18 100644
--- a/stream.c
+++ b/stream.c
@@ -932,7 +932,7 @@ struct tcb *tcp;
int arg;
{
struct strioctl si;
- char *name;
+ strict ioctlent *iop;
int in_and_out;
int timod = 0;
#ifdef SI_GETUDATA
@@ -947,10 +947,12 @@ int arg;
return 1;
}
if (entering(tcp)) {
- name = ioctl_lookup(si.ic_cmd);
- if (name)
- tprintf(", {ic_cmd=%s", name);
- else
+ iop = ioctl_lookup(si.ic_cmd);
+ if (iop) {
+ tprintf(", {ic_cmd=%s", iop->symbol);
+ while ((iop = ioctl_next_match(iop)))
+ tprintf(" or %s", iop->symbol);
+ } else
tprintf(", {ic_cmd=%#x", si.ic_cmd);
if (si.ic_timout == INFTIM)
tprintf(", ic_timout=INFTIM, ");