summaryrefslogtreecommitdiff
path: root/ioctl.c
diff options
context:
space:
mode:
authorWichert Akkerman <wichert@deephackmode.org>2001-03-17 17:26:34 +0000
committerWichert Akkerman <wichert@deephackmode.org>2001-03-17 17:26:34 +0000
commita966785753cbabaf44b39c75d387adf423e44caa (patch)
treec694970ed34bbf25f4e5fbd911bb1f895e402c11 /ioctl.c
parentcf1de759ed0bc7b83665beeb4953b6b37e9e186d (diff)
downloadstrace-a966785753cbabaf44b39c75d387adf423e44caa.tar.gz
strace-a966785753cbabaf44b39c75d387adf423e44caa.tar.bz2
strace-a966785753cbabaf44b39c75d387adf423e44caa.tar.xz
Implement new way to get the ioctl list for Linux: instead of
trying to #include every possible kernel header grab all the relevant #defines from them and use those directly.
Diffstat (limited to 'ioctl.c')
-rw-r--r--ioctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ioctl.c b/ioctl.c
index ed2a32b..9286bab 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -43,6 +43,10 @@ struct ioctlent ioctlent0[] = {
#include "ioctlent.h"
};
+#ifdef LINUX
+#include <asm/ioctl.h>
+#endif
+
int nioctlents0 = sizeof ioctlent0 / sizeof ioctlent0[0];
#if SUPPORTED_PERSONALITIES >= 2
@@ -81,6 +85,9 @@ long code;
struct ioctlent *iop, ioent;
ioent.code = code;
+#ifdef LINUX
+ ioent.code &= (_IOC_NRMASK|_IOC_TYPEMASK);
+#endif
iop = (struct ioctlent *) bsearch((char *) &ioent, (char *) ioctlent,
nioctlents, sizeof(struct ioctlent), compare);
return iop ? iop->symbol : NULL;