cleanup src/linux and src/misc trees, etc.
[musl] / src / linux / eventfd.c
1 #include <sys/eventfd.h>
2 #include <unistd.h>
3 #include "syscall.h"
4
5 int eventfd(unsigned int count, int flags)
6 {
7         return syscall(flags ? SYS_eventfd2 : SYS_eventfd, count, flags);
8 }
9
10 int eventfd_read(int fd, eventfd_t *value)
11 {
12         return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
13 }
14
15 int eventfd_write(int fd, eventfd_t value)
16 {
17         return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1;
18 }