mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
e18efcbd6a
has been broken at least since 4.4Lite moved most of the #defines out of <sys/ioctl.h>. This should be done better. Only a few headers are searched. Added some #includes so that ioctl.c compiles. The networking headers have a maze of undocumented interdependencies and ioctl.c now actually supports networking ioctls.
40 lines
903 B
Text
40 lines
903 B
Text
# XXX should we use an ANSI cpp?
|
|
# XXX does -I$DESTDIR/usr/include actually work?
|
|
(echo "#include <sys/ioctl.h>"
|
|
echo "#include <sys/ioctl_compat.h>"
|
|
) | cpp -I$DESTDIR/usr/include -dM | awk '
|
|
BEGIN {
|
|
print "#include <sys/param.h>"
|
|
print "#include <sys/queue.h>"
|
|
print "#include <sys/socket.h>"
|
|
print "#include <sys/socketvar.h>"
|
|
print "#include <net/route.h>"
|
|
print "#include <net/if.h>"
|
|
print "#include <netinet/in.h>"
|
|
print "#include <netinet/ip_mroute.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 "}"
|
|
}
|
|
'
|