summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/h2pl/getioctlsizes
blob: 403fffaf86cef3f79cdbba0936d790b360920894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

open (IOCTLS,'/usr/include/sys/ioctl.h') || die "ioctl open failed";

while (<IOCTLS>) {
    if (/^\s*#\s*define\s+\w+\s+_IO(R|W|WR)\('?\w+'?,\s*\w+,\s*([^)]+)/) {
	$need{$2}++;
    } 
}

foreach $key ( sort keys %need ) {
    print $key,"\n";
}