Home | History | Annotate | Line # | Download | only in kdump
mkioctls revision 1.5
      1 #	$Id: mkioctls,v 1.5 1995/01/15 07:51:08 mycroft Exp $
      2 #
      3 cpp -dM ${1+"$@"} | awk '
      4 BEGIN {
      5 	print "#include <sys/param.h>"
      6 	print "#include <sys/socket.h>"
      7 	print "#include <sys/socketvar.h>"
      8 	print "#include <net/route.h>"
      9 	print "#include <net/if.h>"
     10 	print "#include <sys/termios.h>"
     11 	print "#define COMPAT_43"
     12 	print "#include <sys/ioctl.h>"
     13 	print ""
     14 	print "char *"
     15 	print "ioctlname(val)"
     16 	print "\tlong val;"
     17 	print "{"
     18 	print ""
     19 }
     20 
     21 /^#[ 	]*define[ 	]*(TIO|FIO|SIO|OSIO)[A-Z]*[ 	]*_IO/ {
     22 	
     23 	# find where the name starts
     24 	for (i = 1; i <= NF; i++)
     25 		if ($i ~ /define/)
     26 			break;
     27 	++i;
     28 	# 
     29 	printf("\tif (val == %s)\n\t\treturn (\"%s\");\n", $i, $i);
     30 
     31 }
     32 END {
     33 	print "\n\treturn (NULL);"
     34 	print "}"
     35 }
     36 '
     37