Using libev with /sys/class/gpios

Deri James deri at
Wed Nov 22 02:39:13 CET 2017

The file /sys/class/gpio/gpio??/value is a pseudo file which reflect the current 
state of various hardware pins 0/1 depending on whether they are high/low. 
They are always in a "readable" state, so EV_READ is not useful. The kernel 
actually raises an interrupt when the state changes and using POLLPRI |
POLLERR with the standard poll() routine seems to work Ok.

I am using on a Raspberry pi which has about 25 of these pins, and it 
works if I use IO::Poll, but I can't work out how to pass the POLLPRI | 
POLLERR flags as a io watcher with EV.

Is it possible to do this with the libev library?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the libev mailing list