add acct, accept4, setns, and dup3 syscalls (linux extensions)
based on patch by Justin Cormack
This commit is contained in:
parent
b10d0230c1
commit
6cf8bfdb64
8 changed files with 113 additions and 0 deletions
9
src/linux/accept4.c
Normal file
9
src/linux/accept4.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
10
src/linux/dup3.c
Normal file
10
src/linux/dup3.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
9
src/linux/setns.c
Normal file
9
src/linux/setns.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue