#!/usr/bin/perl # # tested with linux 2.2.14 # reads , outputs syscalls-linux.h $date = `date`; print < syscalls-linux.h // EOF $max = 0; while () { $line = $_; next unless /#define __NR_[a-z]/; s/.*NR_//; undef $number; ($name, $number) = split (/[\s]+/); if ((length $number) < 1) { die "bad line: $line"; } if ($number > $max) { $max = $number; } print "DEF_SYSCALL($number, \"$name\")\n"; } print "#define N_SYSCALLS $max\n";