summaryrefslogtreecommitdiff
path: root/lib/mlibc/sysdeps/keyronex/generic/linux.cpp
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/sysdeps/keyronex/generic/linux.cpp
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/sysdeps/keyronex/generic/linux.cpp')
-rw-r--r--lib/mlibc/sysdeps/keyronex/generic/linux.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/mlibc/sysdeps/keyronex/generic/linux.cpp b/lib/mlibc/sysdeps/keyronex/generic/linux.cpp
new file mode 100644
index 0000000..9b4a4c7
--- /dev/null
+++ b/lib/mlibc/sysdeps/keyronex/generic/linux.cpp
@@ -0,0 +1,41 @@
+#include <sys/types.h>
+
+#include <keyronex/syscall.h>
+#include <mlibc/ansi-sysdeps.hpp>
+#include <mlibc/debug.hpp>
+#include <mlibc/posix-sysdeps.hpp>
+#include <mlibc/linux-sysdeps.hpp>
+
+namespace mlibc {
+
+int
+sys_epoll_pwait(int epfd, struct epoll_event *ev, int n, int timeout,
+ const sigset_t *sigmask, int *raised)
+{
+ uintptr_t ret = syscall5(kPXSysEPollWait, epfd, (uintptr_t)ev, n,
+ timeout, (uintptr_t)sigmask, NULL);
+ if (int e = sc_error(ret); e)
+ return e;
+ *raised = ret;
+ return 0;
+}
+
+int
+sys_epoll_create(int flags, int *fd)
+{
+ uintptr_t ret = syscall1(kPXSysEPollCreate, flags, NULL);
+ if (int e = sc_error(ret); e)
+ return e;
+ *fd = ret;
+ return 0;
+}
+
+int
+sys_epoll_ctl(int epfd, int mode, int fd, struct epoll_event *ev)
+{
+ uintptr_t ret = syscall4(kPXSysEPollCtl, epfd, mode, fd, (uintptr_t)ev,
+ NULL);
+ return sc_error(ret);
+}
+
+} \ No newline at end of file