aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/generic/poll.cpp
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:52 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 18:24:51 -0500
commitf5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 (patch)
tree93b156621dc0303816b37f60ba88051b702d92f6 /lib/mlibc/options/posix/generic/poll.cpp
parentbd5969fc876a10b18613302db7087ef3c40f18e1 (diff)
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/generic/poll.cpp')
-rw-r--r--lib/mlibc/options/posix/generic/poll.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/mlibc/options/posix/generic/poll.cpp b/lib/mlibc/options/posix/generic/poll.cpp
deleted file mode 100644
index c34e25e..0000000
--- a/lib/mlibc/options/posix/generic/poll.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#include <errno.h>
-#include <poll.h>
-
-#include <bits/ensure.h>
-#include <mlibc/debug.hpp>
-#include <mlibc/posix-sysdeps.hpp>
-
-int poll(struct pollfd *fds, nfds_t count, int timeout) {
- int num_events;
- MLIBC_CHECK_OR_ENOSYS(mlibc::sys_poll, -1);
- if(int e = mlibc::sys_poll(fds, count, timeout, &num_events); e) {
- errno = e;
- return -1;
- }
- return num_events;
-}
-
-#if __MLIBC_LINUX_OPTION
-int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, const sigset_t *sigmask) {
- sigset_t origmask;
- int timeout = (timeout_ts == NULL) ? -1 : (timeout_ts->tv_sec * 1000 + timeout_ts->tv_nsec / 1000000);
-
- sigprocmask(SIG_SETMASK, sigmask, &origmask);
- int ready = poll(fds, nfds, timeout);
- sigprocmask(SIG_SETMASK, &origmask, NULL);
-
- return ready;
-}
-#endif // __MLIBC_LINUX_OPTION
-