mkioctls revision 2782
11590Srgrimesawk ' 21590SrgrimesBEGIN { 31590Srgrimes print "#include <sys/param.h>" 41590Srgrimes print "#include <sys/socket.h>" 51590Srgrimes print "#include <sys/socketvar.h>" 61590Srgrimes print "#include <net/route.h>" 71590Srgrimes print "#include <net/if.h>" 81590Srgrimes print "#include <sys/termios.h>" 91590Srgrimes print "#define COMPAT_43" 101590Srgrimes print "#include <sys/ioctl.h>" 111590Srgrimes print "" 121590Srgrimes print "char *" 131590Srgrimes print "ioctlname(val)" 141590Srgrimes print "{" 151590Srgrimes print "" 161590Srgrimes} 171590Srgrimes 181590Srgrimes/^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ { 191590Srgrimes 201590Srgrimes # find where the name starts 211590Srgrimes for (i = 1; i <= NF; i++) 221590Srgrimes if ($i ~ /define/) 231590Srgrimes break; 241590Srgrimes ++i; 251590Srgrimes # 261590Srgrimes printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i); 271590Srgrimes 281590Srgrimes} 291590SrgrimesEND { 301590Srgrimes print "\n\treturn(NULL);" 311590Srgrimes print "}" 321590Srgrimes} 332782Sswallace' $DESTDIR/usr/include/sys/ioctl.h $DESTDIR/usr/include/sys/ioctl_compat.h 34