summaryrefslogtreecommitdiffstats
path: root/ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch')
-rw-r--r--ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch b/ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch
new file mode 100644
index 000000000..17319a19b
--- /dev/null
+++ b/ipc/chromium/src/third_party/libevent/patches/use-non-deprecated-syscalls.patch
@@ -0,0 +1,43 @@
+---
+ ipc/chromium/src/third_party/libevent/epoll_sub.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- mozilla-central.orig/ipc/chromium/src/third_party/libevent/epoll_sub.c
++++ mozilla-central/ipc/chromium/src/third_party/libevent/epoll_sub.c
+@@ -29,15 +29,24 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/syscall.h>
+ #include <sys/epoll.h>
+ #include <unistd.h>
++#include <errno.h>
+
+ int
+ 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));
++#endif
+ }
+
+ int
+ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
+ {
+@@ -46,7 +55,11 @@ epoll_ctl(int epfd, int op, int fd, stru
+ }
+
+ int
+ 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));
++#endif
+ }