Commit 727a7d1e authored by Brian Gerst's avatar Brian Gerst Committed by Linus Torvalds

[PATCH] unistd.h cleanups

This patch removes the stubs for syscalls that are not used from the
kernel anymore.
parent b7625799
......@@ -533,12 +533,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
#include <linux/signal.h>
#include <asm/ptrace.h>
extern void sys_idle(void);
static inline void idle(void)
{
sys_idle();
}
extern long sys_open(const char *, int, int);
static inline long open(const char * name, int mode, int flags)
{
......@@ -597,12 +591,6 @@ static inline long setsid(void)
return sys_setsid();
}
extern long sys_sync(void);
static inline long sync(void)
{
return sys_sync();
}
struct rusage;
extern asmlinkage long sys_wait4(pid_t, unsigned int *, int, struct rusage *);
static inline pid_t waitpid(int pid, int * wait_stat, int flags)
......@@ -610,17 +598,6 @@ static inline pid_t waitpid(int pid, int * wait_stat, int flags)
return sys_wait4(pid, wait_stat, flags, NULL);
}
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
extern long sys_delete_module(const char *name);
static inline long delete_module(const char *name)
{
return sys_delete_module(name);
}
#endif
/*
......
......@@ -403,24 +403,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
struct rusage;
asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
static inline long idle(void)
{
extern long sys_idle(void);
return sys_idle();
}
static inline long pause(void)
{
extern long sys_pause(void);
return sys_pause();
}
static inline long sync(void)
{
extern long sys_sync(void);
return sys_sync();
}
static inline pid_t setsid(void)
{
extern long sys_setsid(void);
......@@ -474,17 +456,6 @@ static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
return sys_wait4((int)pid, wait_stat, options, NULL);
}
static inline long delete_module(const char *name)
{
extern long sys_delete_module(const char *name);
return sys_delete_module(name);
}
static inline pid_t wait(int * wait_stat)
{
return sys_wait4(-1, wait_stat, 0, NULL);
}
/*
* The following two can't be eliminated yet - they rely on
* specific conditions.
......
......@@ -365,12 +365,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,idle)
static inline _syscall0(int,fork)
static inline _syscall2(int,clone,unsigned long,flags,char *,esp)
static inline _syscall0(int,pause)
static inline _syscall0(int,setup)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall1(int,dup,int,fd)
......@@ -384,14 +378,6 @@ static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
/* the following are just while developing the elinux port! */
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
static inline _syscall2(int,socketcall,int,call,unsigned long *,args)
static inline _syscall3(int,ioctl,unsigned int,fd,unsigned int,cmd,unsigned long,arg)
static inline _syscall5(int,mount,const char *,a,const char *,b,const char *,c,unsigned long,rwflag,const void *,data)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
......
......@@ -362,8 +362,6 @@ __syscall_return(type,__res); \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,pause)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -374,12 +372,6 @@ static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static inline _syscall1(int,delete_module,const char *,name)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
......
......@@ -309,7 +309,6 @@ name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
struct rusage;
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -319,7 +318,6 @@ static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall4(pid_t,wait4,pid_t,pid,int *,wait_stat,int,options,struct rusage*, rusage)
static inline _syscall1(int,delete_module,const char *,name)
static inline _syscall2(pid_t,clone,unsigned long,flags,void*,sp);
#define __NR__exit __NR_exit
......@@ -331,12 +329,6 @@ waitpid (int pid, int *wait_stat, int flags)
return wait4(pid, wait_stat, flags, NULL);
}
static inline pid_t
wait (int * wait_stat)
{
return wait4(-1, wait_stat, 0, 0);
}
#endif /* __KERNEL_SYSCALLS__ */
/*
......
......@@ -350,8 +350,6 @@ __syscall_return(type,__res); \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,pause)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -362,12 +360,6 @@ static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static inline _syscall1(int,delete_module,const char *,name)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
......
......@@ -467,7 +467,6 @@ return -1; \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -478,12 +477,6 @@ static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static inline _syscall1(int,delete_module,const char *,name)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* !defined (__KERNEL_SYSCALLS__) */
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
......
......@@ -793,7 +793,6 @@ return -1; \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -804,12 +803,6 @@ static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static inline _syscall1(int,delete_module,const char *,name)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* !defined (__KERNEL_SYSCALLS__) */
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
......
......@@ -806,24 +806,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
#ifdef __KERNEL_SYSCALLS__
static inline int idle(void)
{
extern int sys_idle(void);
return sys_idle();
}
static inline int pause(void)
{
extern int sys_pause(void);
return sys_pause();
}
static inline int sync(void)
{
extern int sys_sync(void);
return sys_sync();
}
static inline pid_t setsid(void)
{
extern int sys_setsid(void);
......@@ -877,18 +859,6 @@ static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
return sys_wait4((int)pid, wait_stat, options, NULL);
}
static inline int delete_module(const char *name)
{
extern int sys_delete_module(const char *name);
return sys_delete_module(name);
}
static inline pid_t wait(int * wait_stat)
{
extern int sys_wait4(int, int *, int, struct rusage *);
return sys_wait4(-1, wait_stat, 0, NULL);
}
static inline int execve(char *filename, char * argv [],
char * envp[])
{
......
......@@ -436,10 +436,6 @@ extern int open(const char *file, int flag, int mode);
extern int close(int fd);
extern pid_t waitpid(pid_t pid, int *wait_stat, int options);
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1, wait_stat, 0);
}
#endif /* __KERNEL_SYSCALLS__ */
/*
......
......@@ -431,8 +431,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
* System call prototypes.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,pause)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -443,12 +441,6 @@ static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static inline _syscall1(int,delete_module,const char *,name)
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* __KERNEL_SYSCALLS__ */
......
......@@ -378,9 +378,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,idle)
static inline _syscall0(int,pause)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -390,7 +387,6 @@ static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall1(int,delete_module,const char *,name)
static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
struct rusage;
......@@ -400,11 +396,6 @@ static inline pid_t waitpid(int pid, int *wait_stat, int flags)
return sys_wait4(pid, wait_stat, flags, NULL);
}
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
/*
......
......@@ -345,9 +345,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
* some others too.
*/
#define __NR__exit __NR_exit
static inline _syscall0(int,idle)
static inline _syscall0(int,pause)
static inline _syscall0(int,sync)
static inline _syscall0(pid_t,setsid)
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -357,7 +354,6 @@ static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
static inline _syscall1(int,close,int,fd)
static inline _syscall1(int,_exit,int,exitcode)
static inline _syscall1(int,delete_module,const char *,name)
static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
struct rusage;
......@@ -367,11 +363,6 @@ static inline pid_t waitpid(int pid, int *wait_stat, int flags)
return sys_wait4(pid, wait_stat, flags, NULL);
}
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
/*
......
......@@ -347,8 +347,6 @@ __syscall_return(type,__sc0); \
* some others too.
*/
#define __NR__exit __NR_exit
static __inline__ _syscall0(int,pause)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count)
static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -359,12 +357,7 @@ static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode)
static __inline__ _syscall1(int,close,int,fd)
static __inline__ _syscall1(int,_exit,int,exitcode)
static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static __inline__ _syscall1(int,delete_module,const char *,name)
static __inline__ pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif
/*
......
......@@ -416,8 +416,6 @@ return -1; \
* some others too.
*/
#define __NR__exit __NR_exit
static __inline__ _syscall0(int,pause)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -428,12 +426,6 @@ static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
static __inline__ _syscall1(int,close,int,fd)
static __inline__ _syscall1(int,_exit,int,exitcode)
static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static __inline__ _syscall1(int,delete_module,const char *,name)
static __inline__ pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* __KERNEL_SYSCALLS__ */
......
......@@ -406,8 +406,6 @@ return -1; \
* some others too.
*/
#define __NR__exit __NR_exit
static __inline__ _syscall0(int,pause)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
......@@ -418,12 +416,6 @@ static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
static __inline__ _syscall1(int,close,int,fd)
static __inline__ _syscall1(int,_exit,int,exitcode)
static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
static __inline__ _syscall1(int,delete_module,const char *,name)
static __inline__ pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* __KERNEL_SYSCALLS__ */
......
......@@ -61,11 +61,6 @@ static inline long waitpid(pid_t pid, unsigned int *status, int options)
KERNEL_CALL(pid_t, sys_wait4, pid, status, options, NULL)
}
static inline pid_t wait(int *status)
{
KERNEL_CALL(pid_t, sys_wait4, -1, status, 0, NULL)
}
static inline pid_t setsid(void)
{
KERNEL_CALL(pid_t, sys_setsid)
......
......@@ -573,18 +573,6 @@ __syscall_return(type,__res); \
*/
#define __NR__exit __NR_exit
extern long sys_pause(void);
static inline long pause(void)
{
return sys_pause();
}
extern long sys_sync(void);
static inline long sync(void)
{
return sys_sync();
}
extern pid_t sys_setsid(void);
static inline pid_t setsid(void)
{
......@@ -636,12 +624,6 @@ extern inline long exit(int error_code)
sys_exit(error_code);
}
extern long sys_delete_module(const char *);
static inline long delete_module(const char *name_user)
{
return sys_delete_module(name_user);
}
struct rusage;
asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr,
int options, struct rusage * ru);
......@@ -650,11 +632,6 @@ static inline pid_t waitpid(int pid, int * wait_stat, int flags)
return sys_wait4(pid, wait_stat, flags, NULL);
}
static inline pid_t wait(int * wait_stat)
{
return waitpid(-1,wait_stat,0);
}
#endif /* __KERNEL_SYSCALLS__ */
#endif /* __NO_STUBS */
......
......@@ -710,7 +710,7 @@ static void __init handle_initrd(void)
pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
if (pid > 0) {
while (pid != wait(&i))
while (pid != waitpid(-1, &i, 0))
yield();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment