#!/usr/bin/perl

open (IOCTLS,'/scratch/petalinux-yocto/yocto_downloads_2018.1_microblazeel-v10.0-bs-cmp-ml-generic/build_microblazeel-v10.0-bs-cmp-ml-generic/tmp/work/microblazeel-v10.0-bs-cmp-re-ml-xilinx-linux/perl/5.24.1-r0/recipe-sysroot/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";
} 
