Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: fusl/src/linux/signalfd.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/linux/settimeofday.c ('k') | fusl/src/linux/splice.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/linux/signalfd.c
diff --git a/fusl/src/linux/signalfd.c b/fusl/src/linux/signalfd.c
new file mode 100644
index 0000000000000000000000000000000000000000..4bf43326fe5a7ee55858e728cf5bcff07bb64667
--- /dev/null
+++ b/fusl/src/linux/signalfd.c
@@ -0,0 +1,21 @@
+#include <sys/signalfd.h>
+#include <signal.h>
+#include <errno.h>
+#include <fcntl.h>
+#include "syscall.h"
+
+int signalfd(int fd, const sigset_t *sigs, int flags)
+{
+ int ret = __syscall(SYS_signalfd4, fd, sigs, _NSIG/8, flags);
+#ifdef SYS_signalfd
+ if (ret != -ENOSYS) return __syscall_ret(ret);
+ ret = __syscall(SYS_signalfd, fd, sigs, _NSIG/8);
+ if (ret >= 0) {
+ if (flags & SFD_CLOEXEC)
+ __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
+ if (flags & SFD_NONBLOCK)
+ __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
+ }
+#endif
+ return __syscall_ret(ret);
+}
« no previous file with comments | « fusl/src/linux/settimeofday.c ('k') | fusl/src/linux/splice.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698