summaryrefslogtreecommitdiffstats
path: root/usr.bin/kdump/mkioctls
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/kdump/mkioctls')
-rw-r--r--usr.bin/kdump/mkioctls33
1 files changed, 33 insertions, 0 deletions
diff --git a/usr.bin/kdump/mkioctls b/usr.bin/kdump/mkioctls
new file mode 100644
index 0000000..acba53b
--- /dev/null
+++ b/usr.bin/kdump/mkioctls
@@ -0,0 +1,33 @@
+awk '
+BEGIN {
+ print "#include <sys/param.h>"
+ print "#include <sys/socket.h>"
+ print "#include <sys/socketvar.h>"
+ print "#include <net/route.h>"
+ print "#include <net/if.h>"
+ print "#include <sys/termios.h>"
+ print "#define COMPAT_43"
+ print "#include <sys/ioctl.h>"
+ print ""
+ print "char *"
+ print "ioctlname(val)"
+ print "{"
+ print ""
+}
+
+/^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ {
+
+ # find where the name starts
+ for (i = 1; i <= NF; i++)
+ if ($i ~ /define/)
+ break;
+ ++i;
+ #
+ printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
+
+}
+END {
+ print "\n\treturn(NULL);"
+ print "}"
+}
+' /usr/include/sys/ioctl.h /usr/include/sys/ioctl_compat.h
OpenPOWER on IntegriCloud