diff options
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/port/llib-lc | 1 | ||||
-rw-r--r-- | usr/src/lib/libc/port/sys/epoll.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/lib/libc/port/llib-lc b/usr/src/lib/libc/port/llib-lc index b86f23280c..d33a1d39c2 100644 --- a/usr/src/lib/libc/port/llib-lc +++ b/usr/src/lib/libc/port/llib-lc @@ -99,6 +99,7 @@ #include <sys/cladm.h> #include <sys/corectl.h> #include <sys/dl.h> +#include <sys/epoll.h> #include <sys/exacct.h> #include <sys/fcntl.h> #include <sys/file.h> diff --git a/usr/src/lib/libc/port/sys/epoll.c b/usr/src/lib/libc/port/sys/epoll.c index 543856b2ec..34cb151135 100644 --- a/usr/src/lib/libc/port/sys/epoll.c +++ b/usr/src/lib/libc/port/sys/epoll.c @@ -95,8 +95,15 @@ epoll_create1(int flags) { int fd, oflags = O_RDWR; - if (flags & EPOLL_CLOEXEC) + if (flags & EPOLL_CLOEXEC) { oflags |= O_CLOEXEC; + flags ^= EPOLL_CLOEXEC; + } + /* Reject unrecognized flags */ + if (flags != 0) { + errno = EINVAL; + return (-1); + } if ((fd = open("/dev/poll", oflags)) == -1) return (-1); |