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.
diff --git a/ioctl.c b/ioctl.c
index ed2a32b..9286bab 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -43,6 +43,10 @@
#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 @@
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;