Browse Source

Fix unified syscall stuff for changed ?stat. Move fork to syscalls.c wrapped
with a check for NO_MMU of course.

Manuel Novoa III 23 years ago
parent
commit
80831beee1

+ 3 - 6
libc/sysdeps/linux/common/str_syscalls.sh

@@ -14,9 +14,9 @@ echo "#define __NR__fcntl __NR_fcntl"
 echo "#define __NR__reboot __NR_reboot"
 echo "#define __NR__mmap __NR_mmap"
 echo "#define __NR__syslog __NR_syslog"
-echo "#define __NR__stat __NR_stat"
-echo "#define __NR__lstat __NR_lstat"
-echo "#define __NR__fstat __NR_fstat"
+echo "#define __NR___stat __NR_stat"
+echo "#define __NR___lstat __NR_lstat"
+echo "#define __NR___fstat __NR_fstat"
 echo "#define __NR__getdents __NR_getdents"
 echo "#define __NR___ptrace __NR_ptrace"
 echo
@@ -29,9 +29,6 @@ echo "printf(\"#define __STR_NR_fcntl    __STR_NR__fcntl\n\");"
 echo "printf(\"#define __STR_NR_reboot   __STR_NR__reboot\n\");"
 echo "printf(\"#define __STR_NR_mmap     __STR_NR__mmap\n\");"
 echo "printf(\"#define __STR_NR_syslog   __STR_NR__syslog\n\");"
-echo "printf(\"#define __STR_NR_stat     __STR_NR__stat\n\");"
-echo "printf(\"#define __STR_NR_lstat    __STR_NR__lstat\n\");"
-echo "printf(\"#define __STR_NR_fstat    __STR_NR__fstat\n\");"
 echo "printf(\"#define __STR_NR_getdents __STR_NR__getdents\n\");"
 echo
 echo "return EXIT_SUCCESS; }"

+ 7 - 6
libc/sysdeps/linux/common/syscalls.c

@@ -26,10 +26,6 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
-#define uClibc_syscall_exit(void, _exit, int, status) \
-_syscall1(void, _exit, int, status)
-
-
 #include "unified_syscall.h"
 
 //#define __NR_exit             1
@@ -37,11 +33,16 @@ _syscall1(void, _exit, int, status)
 /* Do not include unistd.h, so gcc doesn't whine about 
  * _exit returning.  It really doesn't return... */
 #define __NR__exit __NR_exit
-uClibc_syscall_exit(void, _exit, int, status);
+_syscall1(void, _exit, int, status);
 #endif
 
 //#define __NR_fork             2
-//See architecture specific implementation...
+#ifdef L_fork
+#ifndef __HAS_NO_MMU__
+#include <unistd.h>
+_syscall0(pid_t, fork);
+#endif
+#endif
 
 //#define __NR_read             3
 #ifdef L_read

+ 0 - 15
libc/sysdeps/linux/common/unified_syscall_i386.h

@@ -7,21 +7,6 @@
 
 #include "str_syscalls.h"
 
-/*
- * Disable the following for now... it only saved space if no other
- * syscalls but _exit were used, and no longer works (__uClibc_main).
- */
-#if 0
-#undef uClibc_syscall_exit
-#define uClibc_syscall_exit(type,name,type1,arg1) \
-__asm__ ( \
-".text\n.align 4\n.global "###name"\n.type "###name",@function\n" \
-#name":;\npushl %ebp;\n" \
-"movl %esp,%ebp;\nsubl $4,%esp;\npushl %ebx;\nmovl 8(%ebp),%ebx;\n" \
-"jmp _start_exit\n.Lfe1"###name":\n.size "###name",.Lfe1"###name"-"###name \
-)
-#endif
-
 #define unified_syscall_body(name) \
 __asm__ ( \
 ".text\n.align 4\n.global "###name"\n.type "###name",@function\n" \