]> Zhao Yanbai Git Server - minix.git/commitdiff
Add vfork() system call
authorArun Thomas <arun@minix3.org>
Fri, 22 Jul 2011 08:55:30 +0000 (10:55 +0200)
committerArun Thomas <arun@minix3.org>
Fri, 22 Jul 2011 08:55:30 +0000 (10:55 +0200)
-Same semantics as fork() as it's really just a stub
-Eases porting of BSD utilities

lib/nbsd_libc/stdlib/system.c
lib/nbsd_libc/sys-minix/MISSING_SYSCALLS
lib/nbsd_libc/sys-minix/Makefile.inc
lib/nbsd_libc/sys-minix/vfork.c [new file with mode: 0644]
nbsd_include/unistd.h

index e5fefa836f4fe16b34b24f9b484e163a240ac642..f0fc1207ee8858fce9098604b5c10086a5ed89ea 100644 (file)
@@ -91,11 +91,7 @@ system(command)
        }
 
        (void)__readlockenv();
-#ifdef __minix
-       switch(pid = fork() ) {
-#else /* !__minix */
        switch(pid = vfork()) {
-#endif /* !__minix */
        case -1:                        /* error */
                (void)__unlockenv();
                sigaction(SIGINT, &intsa, NULL);
index 22698ab7d70d29943b05db890d57b7565aca7ba4..d6de9689c5f00f40d3346e39a41fcacac11da6d9 100644 (file)
@@ -76,4 +76,3 @@ futimes
 utrace
 uuidgen
 vadvise
-vfork
index b9fcb839f963456ebea7fae459c60020d4329405..df94abf6564ebdd18ed9f6f6ba1a9b4a2423b60c 100644 (file)
@@ -16,7 +16,7 @@ SRCS+=        accept.c access.c bind.c brk.c sbrk.c compat.S \
        vectorio.c shutdown.c sigaction.c sigpending.c sigreturn.c sigsuspend.c\
        sigprocmask.c socket.c socketpair.c stat.c statvfs.c symlink.c \
        sync.c syscall.c sysuname.c truncate.c umask.c unlink.c write.c \
-       _exit.c _ucontext.c environ.c __getcwd.c
+       _exit.c _ucontext.c environ.c __getcwd.c vfork.c
 
 # Minix specific syscalls.
 SRCS+= cprofile.c lseek64.c sprofile.c _mcontext.c
diff --git a/lib/nbsd_libc/sys-minix/vfork.c b/lib/nbsd_libc/sys-minix/vfork.c
new file mode 100644 (file)
index 0000000..9433c8a
--- /dev/null
@@ -0,0 +1,16 @@
+#include <sys/cdefs.h>
+#include "namespace.h"
+#include <lib.h>
+
+#include <unistd.h>
+
+#ifdef __weak_alias
+__weak_alias(vfork, _vfork)
+#endif
+
+PUBLIC pid_t vfork()
+{
+  message m;
+
+  return(_syscall(PM_PROC_NR, FORK, &m));
+}
index d93a15ff1b716b08709c9d9ced9191c8de44e751..9eda37fc283c99864a0d04358e4f3418c7aaf64f 100644 (file)
@@ -289,6 +289,8 @@ int  usleep(useconds_t);
 #ifndef __LIBC12_SOURCE__
 pid_t   vfork(void) __RENAME(__vfork14);
 #endif
+#else
+pid_t   vfork(void);
 #endif /* !__minix */
 
 #ifndef __AUDIT__