Doing a non-standard ioctl in Perl

Jonathan Stowe jns at
Fri Nov 7 10:43:27 GMT 2008

2008/11/6 Roger Burton West <roger at>:
> For various reasons, I want to do an EVIOCGRAB ioctl.
> perldoc -f ioctl tells me "require sys/", and gives all sorts of
> scary warnings. But EVIOCGRAB isn't in sys/ What's the approved
> way of doing this? That's the only ioctl I'm likely to want to use in
> this program, so I don't particularly fancy converting a whole bunch of
> others that I'm not going to need.
> If it helps:
> linux/input.h:#define EVIOCGRAB         _IOW('E', 0x90, int)

Is there a linux/ or is it possible to generate one from the
linux/input.h using h2ph ?

EVIOCGRAB would be something like:

   sub EVIOCGRAB () { _IOW(ord('E'), 0x90, 'int');}

where _IOW is defined in asm-generic/ on my system.


More information about the mailing list