remove standalone syscall cruft
authorRich Felker <dalias@aerifal.cx>
Tue, 15 Feb 2011 19:39:02 +0000 (14:39 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 15 Feb 2011 19:39:02 +0000 (14:39 -0500)
this was originally written for an early draft of the library where
non-standard functions would reside in a static library separate from
the shared libc.so, which would implement a pure standard. the idea
was not to depend on an implementation-dependent __syscall_ret
function in the main libc. but it turned out to be better to put
everything in a single library for both static and dynamic linking
uses, and thus the (incomplete) remnants of this feature were just
enlarging the source and binary.

12 files changed:
arch/i386/syscall.h
arch/x86_64/syscall.h
src/linux/chroot.c
src/linux/klogctl.c
src/linux/mount.c
src/linux/sethostname.c
src/linux/swapoff.c
src/linux/swapon.c
src/linux/sysinfo.c
src/linux/utimes.c
src/linux/wait3.c
src/linux/wait4.c

index c87401f..ee871a9 100644 (file)
@@ -7,17 +7,7 @@
 
 #define SYSCALL_SIGSET_SIZE 8
 
 
 #define SYSCALL_SIGSET_SIZE 8
 
-#if defined(SYSCALL_STANDALONE)
-#include <errno.h>
-static inline long __syscall_ret(unsigned long r)
-{
-       if (r >= (unsigned long)-1 - 4096) {
-               errno = -(long)r;
-               return -1;
-       }
-       return (long)r;
-}
-#elif defined(SYSCALL_NORETURN)
+#if defined(SYSCALL_NORETURN)
 static inline long __syscall_ret(unsigned long r)
 {
        for(;;);
 static inline long __syscall_ret(unsigned long r)
 {
        for(;;);
index 0b04b29..cfaa790 100644 (file)
@@ -4,17 +4,7 @@
 #define SYSCALL_LL(x) x, 0
 #define SYSCALL_SIGSET_SIZE 8
 
 #define SYSCALL_LL(x) x, 0
 #define SYSCALL_SIGSET_SIZE 8
 
-#if defined(SYSCALL_STANDALONE)
-#include <errno.h>
-static inline long __syscall_ret(unsigned long r)
-{
-       if (r >= (unsigned long)-1 - 4096) {
-               errno = -(long)r;
-               return -1;
-       }
-       return (long)r;
-}
-#elif defined(SYSCALL_NORETURN)
+#if defined(SYSCALL_NORETURN)
 static inline long __syscall_ret(unsigned long r)
 {
        for(;;);
 static inline long __syscall_ret(unsigned long r)
 {
        for(;;);
index b5af62d..81363a6 100644 (file)
@@ -1,5 +1,4 @@
 #include <unistd.h>
 #include <unistd.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int chroot(const char *path)
 #include "syscall.h"
 
 int chroot(const char *path)
index 6c288af..976f29e 100644 (file)
@@ -1,4 +1,3 @@
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int klogctl (int type, char *buf, int len)
 #include "syscall.h"
 
 int klogctl (int type, char *buf, int len)
index 61299d4..8e3cc12 100644 (file)
@@ -1,5 +1,4 @@
 #include <sys/mount.h>
 #include <sys/mount.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data)
 #include "syscall.h"
 
 int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data)
index f61e0cb..c94325e 100644 (file)
@@ -1,5 +1,4 @@
 #include <unistd.h>
 #include <unistd.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int sethostname(const char *name, size_t len)
 #include "syscall.h"
 
 int sethostname(const char *name, size_t len)
index f6fa794..4f19823 100644 (file)
@@ -1,5 +1,4 @@
 #include <sys/swap.h>
 #include <sys/swap.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int swapoff(const char *path)
 #include "syscall.h"
 
 int swapoff(const char *path)
index 13d2876..5c75247 100644 (file)
@@ -1,5 +1,4 @@
 #include <sys/swap.h>
 #include <sys/swap.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int swapon(const char *path, int flags)
 #include "syscall.h"
 
 int swapon(const char *path, int flags)
index 9866947..c61b7aa 100644 (file)
@@ -1,4 +1,3 @@
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 struct sysinfo;
 #include "syscall.h"
 
 struct sysinfo;
index 99a3b2b..59ee1a8 100644 (file)
@@ -1,5 +1,4 @@
 #include <sys/time.h>
 #include <sys/time.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 int utimes(const char *path, const struct timeval times[2])
 #include "syscall.h"
 
 int utimes(const char *path, const struct timeval times[2])
index dd63707..d1d91b0 100644 (file)
@@ -1,6 +1,5 @@
 #include <sys/wait.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 pid_t wait4(pid_t, int *, int, struct rusage *);
 #include "syscall.h"
 
 pid_t wait4(pid_t, int *, int, struct rusage *);
index dda942d..5dd505a 100644 (file)
@@ -1,7 +1,6 @@
 #include <sys/wait.h>
 #include <sys/resource.h>
 #include <string.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
 #include <string.h>
-#define SYSCALL_STANDALONE
 #include "syscall.h"
 
 pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)
 #include "syscall.h"
 
 pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)