mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Merge remote-tracking branch 'origin/patches-2.0'
This commit is contained in:
commit
99cd818741
13
epoll_sub.c
13
epoll_sub.c
@ -32,11 +32,20 @@
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
epoll_create(int size)
|
epoll_create(int size)
|
||||||
{
|
{
|
||||||
|
#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
|
||||||
|
if (size <= 0) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return (syscall(__NR_epoll_create1, 0));
|
||||||
|
#else
|
||||||
return (syscall(__NR_epoll_create, size));
|
return (syscall(__NR_epoll_create, size));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -49,5 +58,9 @@ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
|
|||||||
int
|
int
|
||||||
epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
|
epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
|
||||||
{
|
{
|
||||||
|
#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
|
||||||
|
return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
|
||||||
|
#else
|
||||||
return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
|
return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user