OSDN Git Service

Default to using fork() for vfork() when no arch specific
authorEric Andersen <andersen@codepoet.org>
Wed, 5 Mar 2003 10:28:53 +0000 (10:28 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 5 Mar 2003 10:28:53 +0000 (10:28 -0000)
implementation of vfork is present.

libc/sysdeps/linux/common/Makefile
libc/sysdeps/linux/common/vfork.c [new file with mode: 0644]

index d51fc42..0646260 100644 (file)
@@ -25,7 +25,7 @@ CSRC= waitpid.c getdnnm.c gethstnm.c getcwd.c ptrace.c \
        cmsg_nxthdr.c longjmp.c open64.c ftruncate64.c mmap64.c \
        truncate64.c getrlimit64.c setrlimit64.c creat64.c \
        llseek.c pread_write.c _exit.c sync.c getdirname.c \
-       sendfile64.c xstatconv.c getdents.c getdents64.c
+       sendfile64.c xstatconv.c getdents.c getdents64.c vfork.c
 ifneq ($(strip $(EXCLUDE_BRK)),y)
 CSRC+=sbrk.c
 endif
diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
new file mode 100644 (file)
index 0000000..ba4f042
--- /dev/null
@@ -0,0 +1,8 @@
+/* Trivial implementation for arches that lack vfork */
+#include <unistd.h>
+#include <sys/types.h>
+
+pid_t vfork(void)
+{
+    return fork();
+}