Browse Source

Handle fork and vfork on a per architecture basis...

Eric Andersen 25 years ago
parent
commit
97112ff6f4

+ 4 - 1
include/unistd.h

@@ -646,8 +646,11 @@ extern int setegid __P ((__gid_t __gid));
 /* Clone the calling process, creating an exact copy.
 /* Clone the calling process, creating an exact copy.
    Return -1 for errors, 0 to the new process,
    Return -1 for errors, 0 to the new process,
    and the process ID of the new process to the old process.  */
    and the process ID of the new process to the old process.  */
-extern __pid_t __fork __P ((void));
+#ifdef __HAS_NO_MMU__
+#define fork fork_not_available_on_mmuless_systems
+#else
 extern __pid_t fork __P ((void));
 extern __pid_t fork __P ((void));
+#endif
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Clone the calling process, but without copying the whole address space.
 /* Clone the calling process, but without copying the whole address space.

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

@@ -28,7 +28,7 @@ ASFLAGS=$(CFLAGS)
 SSRC=_start.S longjmp.S setjmp.S
 SSRC=_start.S longjmp.S setjmp.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 
 
-CSRC=
+CSRC=fork.c vfork.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)

+ 5 - 4
libc/sysdeps/linux/common/syscalls.c

@@ -36,10 +36,7 @@ _syscall1(void, _exit, int, status);
 #endif
 #endif
 
 
 //#define __NR_fork             2
 //#define __NR_fork             2
-#ifdef L_fork
-#include <unistd.h>
-_syscall0(pid_t, fork);
-#endif
+//See architecture specific implementation...
 
 
 //#define __NR_read             3
 //#define __NR_read             3
 #ifdef L_read
 #ifdef L_read
@@ -791,6 +788,7 @@ _syscall1(int, fsync, int, fd);
 //int sigreturn(unsigned long __unused);
 //int sigreturn(unsigned long __unused);
 
 
 //#define __NR_clone            120
 //#define __NR_clone            120
+//See architecture specific implementation...
 
 
 //#define __NR_setdomainname    121
 //#define __NR_setdomainname    121
 #ifdef L_setdomainname
 #ifdef L_setdomainname
@@ -1060,3 +1058,6 @@ SYSCALL__(poll, 3)
 //#define __NR_putpmsg                  189
 //#define __NR_putpmsg                  189
 
 
 //#define __NR_vfork                    190
 //#define __NR_vfork                    190
+//See architecture specific implementation...
+
+

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

@@ -28,7 +28,7 @@ ASFLAGS=$(CFLAGS)
 SSRC=_start.S longjmp.S setjmp.S #_start.S #clone.S
 SSRC=_start.S longjmp.S setjmp.S #_start.S #clone.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 
 
-CSRC=#select.c
+CSRC=fork.c vfork.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 
 OBJS=$(SOBJS) $(COBJS)
 OBJS=$(SOBJS) $(COBJS)

+ 8 - 2
test/string/Makefile

@@ -5,9 +5,15 @@ include $(TOPDIR)Rules.mak
 LSFLAGS = $(shell if ls -sh >/dev/null 2>&1; \
 LSFLAGS = $(shell if ls -sh >/dev/null 2>&1; \
     then echo "-sh"; else echo "-s" ; fi)
     then echo "-sh"; else echo "-s" ; fi)
 
 
-XCFLAGS = -Wall -Os -fomit-frame-pointer -fno-builtin -nostdinc \
+#XCFLAGS = -Wall -Os -fomit-frame-pointer -fno-builtin -nostdinc \
+#	-I$(TOPDIR)include -I/usr/include/linux
+#XLDFLAGS = -nostdlib -s -gc-sections
+STRIPTOOL=/bin/true
+
+
+XCFLAGS = -Wall -g -fno-builtin -nostdinc \
 	-I$(TOPDIR)include -I/usr/include/linux
 	-I$(TOPDIR)include -I/usr/include/linux
-XLDFLAGS = -nostdlib -s -gc-sections
+XLDFLAGS = -nostdlib -gc-sections
 EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 
 
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YCFLAGS = -Wall -Os -fomit-frame-pointer