summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/.cvsignore4
-rw-r--r--libc/sysdeps/linux/common/Makefile21
-rw-r--r--libc/sysdeps/linux/common/create_module.c3
-rw-r--r--libc/sysdeps/linux/common/syscalls.c38
4 files changed, 41 insertions, 25 deletions
diff --git a/libc/sysdeps/linux/common/.cvsignore b/libc/sysdeps/linux/common/.cvsignore
deleted file mode 100644
index 73f129583..000000000
--- a/libc/sysdeps/linux/common/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-unified_syscall.h
-str_syscalls
-str_syscalls.c
-str_syscalls.h
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index 1fea281c7..0b387587d 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -34,16 +34,7 @@ MOBJ=$(shell ./list_syscalls.sh)
OBJ=$(COBJS) $(MOBJ)
-UNIFIED_SYSCALL_HEADER = /dev/null
-STR_SYSCALLS =
-ifeq ($(UNIFIED_SYSCALL),true)
- ifeq ($(TARGET_ARCH), i386)
- UNIFIED_SYSCALL_HEADER = unified_syscall_i386.h
- STR_SYSCALLS = str_syscalls
- endif
-endif
-
-all: $(STR_SYSCALLS) unified_syscall.h $(OBJ) $(LIBC)
+all: $(STR_SYSCALLS) $(OBJ) $(LIBC)
$(LIBC): ar-target
@@ -58,14 +49,6 @@ $(COBJS): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
-str_syscalls:
- /bin/sh ./str_syscalls.sh > str_syscalls.c
- gcc str_syscalls.c -o str_syscalls
- ./str_syscalls > str_syscalls.h
-
-unified_syscall.h:
- cat $(UNIFIED_SYSCALL_HEADER) > unified_syscall.h
-
clean:
- rm -f *.[oa] *~ core unified_syscall.h str_syscalls.[ch] str_syscalls
+ rm -f *.[oa] *~ core
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index 223b909f5..93153c8b3 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -31,6 +31,9 @@
#if defined(__i386__) || defined(__m68k__) || defined(__arm__)
#define __NR___create_module __NR_create_module
+#ifdef __STR_NR_create_module
+#define __STR_NR___create_module __STR_NR_create_module
+#endif
_syscall2(long, __create_module, const char *, name, size_t, size);
/* By checking the value of errno, we know if we have been fooled
* by the syscall2 macro making a very high address look like a
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index 0b82f4973..e7da59b63 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -26,13 +26,14 @@
#include <sys/types.h>
#include <sys/syscall.h>
-#include "unified_syscall.h"
-
//#define __NR_exit 1
#ifdef L__exit
/* Do not include unistd.h, so gcc doesn't whine about
* _exit returning. It really doesn't return... */
#define __NR__exit __NR_exit
+#ifdef __STR_NR_exit
+#define __STR_NR__exit __STR_NR_exit
+#endif
_syscall1(void, _exit, int, status);
#endif
@@ -67,6 +68,9 @@ _syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count);
#include <stdarg.h>
#include <fcntl.h>
#define __NR___open __NR_open
+#ifdef __STR_NR_open
+#define __STR_NR___open __STR_NR_open
+#endif
_syscall3(int, __open, const char *, fn, int, flags, mode_t, mode);
int open(const char *file, int oflag, ...)
@@ -223,6 +227,9 @@ _syscall1(int, stime, time_t *, t);
#ifdef L___ptrace
#include <sys/ptrace.h>
#define __NR___ptrace __NR_ptrace
+#ifdef __STR_NR_ptrace
+#define __STR_NR___ptrace __STR_NR_ptrace
+#endif
_syscall4(long, __ptrace, enum __ptrace_request, request, pid_t, pid,
void*, addr, void*, data);
#endif
@@ -381,6 +388,9 @@ _syscall0(gid_t, getgid);
#include <stdarg.h>
#include <sys/ioctl.h>
#define __NR__ioctl __NR_ioctl
+#ifdef __STR_NR_ioctl
+#define __STR_NR__ioctl __STR_NR_ioctl
+#endif
extern int _ioctl(int fd, int request, void *arg);
_syscall3(int, _ioctl, int, fd, int, request, void *, arg);
@@ -403,6 +413,9 @@ int ioctl(int fd, unsigned long int request, ...)
#include <stdarg.h>
#include <fcntl.h>
#define __NR__fcntl __NR_fcntl
+#ifdef __STR_NR_fcntl
+#define __STR_NR__fcntl __STR_NR_fcntl
+#endif
extern int _fcntl(int fd, int cmd, long arg);
_syscall3(int, _fcntl, int, fd, int, cmd, long, arg);
@@ -596,6 +609,9 @@ _syscall2(int, swapon, const char *, path, int, swapflags);
//#define __NR_reboot 88
#ifdef L__reboot
#define __NR__reboot __NR_reboot
+#ifdef __STR_NR_reboot
+#define __STR_NR__reboot __STR_NR_reboot
+#endif
extern int _reboot(int magic, int magic2, int flag);
_syscall3(int, _reboot, int, magic, int, magic2, int, flag);
@@ -611,6 +627,9 @@ int reboot(int flag)
//#define __NR_mmap 90
#ifdef L__mmap
#define __NR__mmap __NR_mmap
+#ifdef __STR_NR_mmap
+#define __STR_NR__mmap __STR_NR_mmap
+#endif
#include <unistd.h>
#include <sys/mman.h>
extern __ptr_t _mmap(unsigned long *buffer);
@@ -712,6 +731,9 @@ _syscall2(int, socketcall, int, call, unsigned long *, args);
#ifdef L__syslog
#include <unistd.h>
#define __NR__syslog __NR_syslog
+#ifdef __STR_NR_syslog
+#define __STR_NR__syslog __STR_NR_syslog
+#endif
extern int _syslog(int type, char *buf, int len);
_syscall3(int, _syslog, int, type, char *, buf, int, len);
@@ -741,6 +763,9 @@ _syscall2(int, getitimer, enum __itimer_which, which, struct itimerval *, value)
#include <unistd.h>
#include "statfix.h"
#define __NR___stat __NR_stat
+#ifdef __STR_NR_stat
+#define __STR_NR___stat __STR_NR_stat
+#endif
extern int __stat(const char *file_name, struct kernel_stat *buf);
_syscall2(int, __stat, const char *, file_name, struct kernel_stat *, buf);
@@ -766,6 +791,9 @@ int stat(const char *file_name, struct libc_stat *buf)
#include <unistd.h>
#include "statfix.h"
#define __NR___lstat __NR_lstat
+#ifdef __STR_NR_lstat
+#define __STR_NR___lstat __STR_NR_lstat
+#endif
extern int __lstat(const char *file_name, struct kernel_stat *buf);
_syscall2(int, __lstat, const char *, file_name, struct kernel_stat *, buf);
@@ -791,6 +819,9 @@ int lstat(const char *file_name, struct libc_stat *buf)
#include <unistd.h>
#include "statfix.h"
#define __NR___fstat __NR_fstat
+#ifdef __STR_NR_fstat
+#define __STR_NR___fstat __STR_NR_fstat
+#endif
extern int __fstat(int filedes, struct kernel_stat *buf);
_syscall2(int, __fstat, int, filedes, struct kernel_stat *, buf);
@@ -858,6 +889,9 @@ _syscall1(int, sysinfo, struct sysinfo *, info);
//#define __NR_ipc 117
#ifdef L___ipc
#define __NR___ipc __NR_ipc
+#ifdef __STR_NR_ipc
+#define __STR_NR___ipc __STR_NR_ipc
+#endif
_syscall5(int, __ipc, unsigned int, call, int, first, int, second, int, third, void *, ptr);
#endif