From 662ce04b9d2cbe2db70e6ae61a4da56c584f3a3c Mon Sep 17 00:00:00 2001 From: Bryan Cantrill Date: Wed, 10 Dec 2014 17:05:26 +0000 Subject: OS-3628 lx brand: add support for eventfd --- usr/src/lib/brand/lx/lx_brand/common/lx_brand.c | 8 ++++---- usr/src/lib/brand/lx/lx_brand/common/misc.c | 17 +++++++++++++++++ usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h | 2 ++ usr/src/lib/brand/lx/zone/platform.xml | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) (limited to 'usr/src') diff --git a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c index 84e115bd4e..c4071d185d 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c +++ b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c @@ -1375,13 +1375,13 @@ static struct lx_sysent sysents[] = { {"epoll_pwait", lx_epoll_pwait, 0, 5}, /* 281 */ {"signalfd", NULL, NOSYS_NULL, 0}, /* 282 */ {"timerfd_create", NULL, NOSYS_NULL, 0}, /* 283 */ - {"eventfd", NULL, NOSYS_NULL, 0}, /* 284 */ + {"eventfd", lx_eventfd, 0, 1}, /* 284 */ {"fallocate", NULL, NOSYS_NULL, 0}, /* 285 */ {"timerfd_settime", NULL, NOSYS_NULL, 0}, /* 286 */ {"timerfd_gettime", NULL, NOSYS_NULL, 0}, /* 287 */ {"accept4", lx_accept4, 0, 4}, /* 288 */ {"signalfd4", NULL, NOSYS_NULL, 0}, /* 289 */ - {"eventfd2", NULL, NOSYS_NULL, 0}, /* 290 */ + {"eventfd2", lx_eventfd2, 0, 2}, /* 290 */ {"epoll_create1", lx_epoll_create1, 0, 1}, /* 291 */ {"dup3", lx_dup3, 0, 3}, /* 292 */ {"pipe2", lx_pipe2, 0, 2}, /* 293 */ @@ -1741,12 +1741,12 @@ static struct lx_sysent sysents[] = { {"utimensat", lx_utimensat, 0, 4}, /* 320 */ {"signalfd", NULL, NOSYS_NULL, 0}, /* 321 */ {"timerfd_create", NULL, NOSYS_NULL, 0}, /* 322 */ - {"eventfd", NULL, NOSYS_NULL, 0}, /* 323 */ + {"eventfd", lx_eventfd, 0, 1}, /* 323 */ {"fallocate", NULL, NOSYS_NULL, 0}, /* 324 */ {"timerfd_settime", NULL, NOSYS_NULL, 0}, /* 325 */ {"timerfd_gettime", NULL, NOSYS_NULL, 0}, /* 326 */ {"signalfd4", NULL, NOSYS_NULL, 0}, /* 327 */ - {"eventfd2", NULL, NOSYS_NULL, 0}, /* 328 */ + {"eventfd2", lx_eventfd2, 0, 2}, /* 328 */ {"epoll_create1", lx_epoll_create1, 0, 1}, /* 329 */ {"dup3", lx_dup3, 0, 3}, /* 330 */ {"pipe2", lx_pipe2, 0, 2}, /* 331 */ diff --git a/usr/src/lib/brand/lx/lx_brand/common/misc.c b/usr/src/lib/brand/lx/lx_brand/common/misc.c index 7064ed64b4..990ee9dce7 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/misc.c +++ b/usr/src/lib/brand/lx/lx_brand/common/misc.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -1107,3 +1108,19 @@ lx_vhangup(void) return (0); } + +long +lx_eventfd(unsigned int initval) +{ + int r = eventfd(initval, 0); + + return (r == -1 ? -errno : r); +} + +long +lx_eventfd2(unsigned int initval, int flags) +{ + int r = eventfd(initval, flags); + + return (r == -1 ? -errno : r); +} diff --git a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h index b5b6f6f1a1..1e5603f93f 100644 --- a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h +++ b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h @@ -321,6 +321,8 @@ extern long lx_epoll_pwait(int, void *, int, int, const sigset_t *); extern long lx_epoll_create(int); extern long lx_epoll_create1(int); extern long lx_epoll_wait(int, void *, int, int); +extern long lx_eventfd(unsigned int); +extern long lx_eventfd2(unsigned int, int); extern long lx_fchdir(int); extern long lx_fchmod(int, mode_t); extern long lx_getgid(void); diff --git a/usr/src/lib/brand/lx/zone/platform.xml b/usr/src/lib/brand/lx/zone/platform.xml index a586d7ae8f..298494e3ed 100644 --- a/usr/src/lib/brand/lx/zone/platform.xml +++ b/usr/src/lib/brand/lx/zone/platform.xml @@ -68,6 +68,7 @@ + -- cgit v1.2.3