additional fixes for linux kernel apis with old syscalls removed
authorRich Felker <dalias@aerifal.cx>
Fri, 30 May 2014 05:51:23 +0000 (01:51 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 30 May 2014 05:51:23 +0000 (01:51 -0400)
src/process/vfork.c
src/stat/fstat.c

index fc4adb464f13c85fc25fc5d5f967d511e13f22eb..ac954651b70167cf62fcc498fb34672a0680e384 100644 (file)
@@ -1,12 +1,17 @@
 #define _GNU_SOURCE
 #include <unistd.h>
+#include <signal.h>
 #include "syscall.h"
 #include "libc.h"
 
 pid_t __vfork(void)
 {
        /* vfork syscall cannot be made from C code */
+#ifdef SYS_fork
        return syscall(SYS_fork);
+#else
+       return syscall(SYS_clone, SIGCHLD, 0);
+#endif
 }
 
 weak_alias(__vfork, vfork);
index b5611767b6b8499ba7b03f9e033bb8421bc23ec2..a92898675dd005ab837cbfbdbbfdfe1527358a23 100644 (file)
@@ -14,7 +14,11 @@ int fstat(int fd, struct stat *st)
 
        char buf[15+3*sizeof(int)];
        __procfdname(buf, fd);
+#ifdef SYS_stat
        return syscall(SYS_stat, buf, st);
+#else
+       return syscall(SYS_fstatat, AT_FDCWD, buf, st);
+#endif
 }
 
 LFS64(fstat);