mirror of
https://github.com/fluencelabs/musl
synced 2025-07-01 07:32:04 +00:00
additional fixes for linux kernel apis with old syscalls removed
This commit is contained in:
@ -1,12 +1,17 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <signal.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
#include "libc.h"
|
#include "libc.h"
|
||||||
|
|
||||||
pid_t __vfork(void)
|
pid_t __vfork(void)
|
||||||
{
|
{
|
||||||
/* vfork syscall cannot be made from C code */
|
/* vfork syscall cannot be made from C code */
|
||||||
|
#ifdef SYS_fork
|
||||||
return syscall(SYS_fork);
|
return syscall(SYS_fork);
|
||||||
|
#else
|
||||||
|
return syscall(SYS_clone, SIGCHLD, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias(__vfork, vfork);
|
weak_alias(__vfork, vfork);
|
||||||
|
@ -14,7 +14,11 @@ int fstat(int fd, struct stat *st)
|
|||||||
|
|
||||||
char buf[15+3*sizeof(int)];
|
char buf[15+3*sizeof(int)];
|
||||||
__procfdname(buf, fd);
|
__procfdname(buf, fd);
|
||||||
|
#ifdef SYS_stat
|
||||||
return syscall(SYS_stat, buf, st);
|
return syscall(SYS_stat, buf, st);
|
||||||
|
#else
|
||||||
|
return syscall(SYS_fstatat, AT_FDCWD, buf, st);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LFS64(fstat);
|
LFS64(fstat);
|
||||||
|
Reference in New Issue
Block a user