提交 9b235e83 编写于 作者: R Rich Felker

remove standalone syscall cruft

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.
上级 44460c6d
...@@ -7,17 +7,7 @@ ...@@ -7,17 +7,7 @@
#define SYSCALL_SIGSET_SIZE 8 #define SYSCALL_SIGSET_SIZE 8
#if defined(SYSCALL_STANDALONE) #if defined(SYSCALL_NORETURN)
#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)
static inline long __syscall_ret(unsigned long r) static inline long __syscall_ret(unsigned long r)
{ {
for(;;); for(;;);
......
...@@ -4,17 +4,7 @@ ...@@ -4,17 +4,7 @@
#define SYSCALL_LL(x) x, 0 #define SYSCALL_LL(x) x, 0
#define SYSCALL_SIGSET_SIZE 8 #define SYSCALL_SIGSET_SIZE 8
#if defined(SYSCALL_STANDALONE) #if defined(SYSCALL_NORETURN)
#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)
static inline long __syscall_ret(unsigned long r) static inline long __syscall_ret(unsigned long r)
{ {
for(;;); for(;;);
......
#include <unistd.h> #include <unistd.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int chroot(const char *path) int chroot(const char *path)
......
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int klogctl (int type, char *buf, int len) int klogctl (int type, char *buf, int len)
......
#include <sys/mount.h> #include <sys/mount.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data) int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data)
......
#include <unistd.h> #include <unistd.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int sethostname(const char *name, size_t len) int sethostname(const char *name, size_t len)
......
#include <sys/swap.h> #include <sys/swap.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int swapoff(const char *path) int swapoff(const char *path)
......
#include <sys/swap.h> #include <sys/swap.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int swapon(const char *path, int flags) int swapon(const char *path, int flags)
......
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
struct sysinfo; struct sysinfo;
......
#include <sys/time.h> #include <sys/time.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
int utimes(const char *path, const struct timeval times[2]) int utimes(const char *path, const struct timeval times[2])
......
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/resource.h> #include <sys/resource.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
pid_t wait4(pid_t, int *, int, struct rusage *); pid_t wait4(pid_t, int *, int, struct rusage *);
......
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <string.h> #include <string.h>
#define SYSCALL_STANDALONE
#include "syscall.h" #include "syscall.h"
pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage) pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册