mirror of /home/gitosis/repositories/libowfat.git
Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat
https://www.fefe.de/libowfat/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
454 B
20 lines
454 B
#include <inttypes.h> |
|
#include <sys/epoll.h> |
|
#include <stdio.h> |
|
|
|
int main() { |
|
int efd=epoll_create(10); |
|
struct epoll_event x; |
|
if (efd==-1) return 111; |
|
x.events=EPOLLIN; |
|
x.data.fd=0; |
|
if (epoll_ctl(efd,EPOLL_CTL_ADD,0 /* fd */,&x)==-1) return 111; |
|
{ |
|
int n; |
|
struct epoll_event y[100]; |
|
if ((n=epoll_wait(efd,y,100,1000))==-1) return 111; |
|
if (n>0) |
|
printf("event %d on fd #%d\n",y[0].events,y[0].data.fd); |
|
} |
|
return 0; |
|
}
|
|
|