<poll.h> Library
Simple implementation of the poll library:
#include <poll.h>
int main()
{
struct pollfd fds[1];
fds[0].fd = open("/sys/class/gpio/gpio6/value", O_RDWR);
fds[0].events = POLLPRI;
fds[0].revents = 0;
int myPoll = poll(fds, 0, 5000);
if (myPoll < 0)
{
// the poll couldn't start
}
else if (myPoll == 0)
{
// the poll timed out!
}
else
{
// do something
}
return 0;
}Last updated