فهرست منبع

Default to using fork() for vfork() when no arch specific
implementation of vfork is present.

Eric Andersen 21 سال پیش
والد
کامیت
a0e60c6d2e
2فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 1 1
      libc/sysdeps/linux/common/Makefile
  2. 8 0
      libc/sysdeps/linux/common/vfork.c

+ 1 - 1
libc/sysdeps/linux/common/Makefile

@@ -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

+ 8 - 0
libc/sysdeps/linux/common/vfork.c

@@ -0,0 +1,8 @@
+/* Trivial implementation for arches that lack vfork */
+#include <unistd.h>
+#include <sys/types.h>
+
+pid_t vfork(void)
+{
+    return fork();
+}