projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
eventfd syscall wrapper and read/write wrappers
[musl]
/
src
/
linux
/
eventfd_read.c
diff --git a/src/linux/eventfd_read.c
b/src/linux/eventfd_read.c
new file mode 100644
(file)
index 0000000..
969e661
--- /dev/null
+++ b/
src/linux/eventfd_read.c
@@ -0,0
+1,7
@@
+#include <sys/eventfd.h>
+#include <unistd.h>
+
+int eventfd_read(int fd, eventfd_t *value)
+{
+ return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
+}