summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2014-12-10 17:05:26 +0000
committerBryan Cantrill <bryan@joyent.com>2014-12-10 17:05:26 +0000
commit662ce04b9d2cbe2db70e6ae61a4da56c584f3a3c (patch)
tree0ce449e11f044d5e1328e6bd1d9bbca131b85256
parentbeb6d9b7f121cfc72dac3b54f40f1bb3fd8e04e9 (diff)
downloadillumos-joyent-20141211.tar.gz
OS-3628 lx brand: add support for eventfd20141211release-20141211
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/lx_brand.c8
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/misc.c17
-rw-r--r--usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h2
-rw-r--r--usr/src/lib/brand/lx/zone/platform.xml1
4 files changed, 24 insertions, 4 deletions
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 <sys/lx_thunk_server.h>
#include <sys/lx_fcntl.h>
#include <sys/inotify.h>
+#include <sys/eventfd.h>
#include <thread.h>
#include <unistd.h>
#include <libintl.h>
@@ -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 @@
<device match="arp" />
<device match="dtrace/*" />
<device match="dtrace/provider/*" />
+ <device match="eventfd" />
<device match="inotify" />
<device match="ipnet" />
<device match="kstat" />