Using libev with /sys/class/gpios

Deri James deri at chuzzlewit.myzen.co.uk
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 EV.pm 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?

Cheers 

Deri

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20171122/fd962edc/attachment.html>


More information about the libev mailing list