嗨,您要使用Epoll的epoll_wait函數,那麼最好要創建evenfd當作file descriptor,函數原型描述如下:
原網址http://man7.org/linux/man-pages/man2/eventfd.2.html
NAME
eventfd - create a file descriptor for event notification
SYNOPSIS
#include <sys/eventfd.h>
int eventfd(unsigned int initval, int flags);
DESCRIPTION
eventfd() creates an "eventfd object" that can be used as an event
wait/notify mechanism by user-space applications, and by the kernel
to notify user-space applications of events. The object contains an
unsigned 64-bit integer (uint64_t) counter that is maintained by the
kernel. This counter is initialized with the value specified in the
argument initval.
以上希望對您有用