musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/linux/accept4.c 9
-rw-r--r--src/linux/dup3.c 10
-rw-r--r--src/linux/setns.c 9
3 files changed, 28 insertions, 0 deletions
diff --git a/src/linux/accept4.c b/src/linux/accept4.c
new file mode 100644
index 00000000..6b5c16ce
--- /dev/null
+++ b/src/linux/accept4.c
@@ -0,0 +1,9 @@
+#define _GNU_SOURCE
+#include <sys/socket.h>
+#include "syscall.h"
+#include "libc.h"
+
+int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
+{
+ return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
+}
diff --git a/src/linux/dup3.c b/src/linux/dup3.c
new file mode 100644
index 00000000..e201ef01
--- /dev/null
+++ b/src/linux/dup3.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <errno.h>
+#include "syscall.h"
+
+int dup3(int old, int new, int flags) {
+ int r;
+ while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY);
+ return __syscall_ret(r);
+}
diff --git a/src/linux/setns.c b/src/linux/setns.c
new file mode 100644
index 00000000..af3eb092
--- /dev/null
+++ b/src/linux/setns.c
@@ -0,0 +1,9 @@
+#define _GNU_SOURCE
+#include <sched.h>
+#include "syscall.h"
+#include "libc.h"
+
+int setns(int fd, int nstype)
+{
+ return syscall(SYS_setns, fd, nstype);
+}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月11日 05:12:09 +0000

AltStyle によって変換されたページ (->オリジナル) /