milestone1
This commit is contained in:
@@ -39,24 +39,7 @@
|
||||
#include <dlfcn.h>
|
||||
#include <sys/time.h>
|
||||
#include <fcntl.h>
|
||||
/* #include <sys/eventfd.h> */
|
||||
#ifndef EFD_CLOEXEC
|
||||
#define EFD_CLOEXEC O_CLOEXEC
|
||||
#endif
|
||||
#ifndef EFD_NONBLOCK
|
||||
#define EFD_NONBLOCK O_NONBLOCK
|
||||
#endif
|
||||
#ifndef EFD_SEMAPHORE
|
||||
#define EFD_SEMAPHORE 0x1
|
||||
#endif
|
||||
static int eventfd(unsigned int initval, int flags) {
|
||||
int oflag = O_RDWR;
|
||||
if (flags & EFD_CLOEXEC) oflag |= O_CLOEXEC;
|
||||
if (flags & EFD_NONBLOCK) oflag |= O_NONBLOCK;
|
||||
char path[64];
|
||||
snprintf(path, sizeof(path), "/scheme/event/eventfd/%u/%d", initval, (flags & EFD_SEMAPHORE) ? 1 : 0);
|
||||
return open(path, oflag);
|
||||
}
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user