2 * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
9 #include <linux/syscalls.h>
10 #include "linux/resource.h"
11 #include "asm/uaccess.h"
13 extern int um_execve(const char *file, char *const argv[], char *const env[]);
16 #define __ARCH_WANT_IPC_PARSE_VERSION
17 #define __ARCH_WANT_OLD_READDIR
18 #define __ARCH_WANT_OLD_STAT
19 #define __ARCH_WANT_STAT64
20 #define __ARCH_WANT_SYS_ALARM
21 #define __ARCH_WANT_SYS_GETHOSTNAME
22 #define __ARCH_WANT_SYS_PAUSE
23 #define __ARCH_WANT_SYS_SGETMASK
24 #define __ARCH_WANT_SYS_SIGNAL
25 #define __ARCH_WANT_SYS_TIME
26 #define __ARCH_WANT_SYS_UTIME
27 #define __ARCH_WANT_SYS_WAITPID
28 #define __ARCH_WANT_SYS_SOCKETCALL
29 #define __ARCH_WANT_SYS_FADVISE64
30 #define __ARCH_WANT_SYS_GETPGRP
31 #define __ARCH_WANT_SYS_LLSEEK
32 #define __ARCH_WANT_SYS_NICE
33 #define __ARCH_WANT_SYS_OLD_GETRLIMIT
34 #define __ARCH_WANT_SYS_OLDUMOUNT
35 #define __ARCH_WANT_SYS_SIGPENDING
36 #define __ARCH_WANT_SYS_SIGPROCMASK
37 #define __ARCH_WANT_SYS_RT_SIGACTION
40 #ifdef __KERNEL_SYSCALLS__
42 #include <linux/compiler.h>
43 #include <linux/types.h>
45 #define KERNEL_CALL(ret_t, sys, args...) \
46 mm_segment_t fs = get_fs(); \
53 static inline long open(const char *pathname, int flags, int mode)
55 KERNEL_CALL(int, sys_open, pathname, flags, mode)
58 static inline long dup(unsigned int fd)
60 KERNEL_CALL(int, sys_dup, fd);
63 static inline long close(unsigned int fd)
65 KERNEL_CALL(int, sys_close, fd);
68 static inline int execve(const char *filename, char *const argv[],
71 KERNEL_CALL(int, um_execve, filename, argv, envp);
74 static inline long waitpid(pid_t pid, unsigned int *status, int options)
76 KERNEL_CALL(pid_t, sys_wait4, pid, status, options, NULL)
79 static inline pid_t setsid(void)
81 KERNEL_CALL(pid_t, sys_setsid)
84 static inline long lseek(unsigned int fd, off_t offset, unsigned int whence)
86 KERNEL_CALL(long, sys_lseek, fd, offset, whence)
89 static inline int read(unsigned int fd, char * buf, int len)
91 KERNEL_CALL(int, sys_read, fd, buf, len)
94 static inline int write(unsigned int fd, char * buf, int len)
96 KERNEL_CALL(int, sys_write, fd, buf, len)
99 long sys_mmap2(unsigned long addr, unsigned long len,
100 unsigned long prot, unsigned long flags,
101 unsigned long fd, unsigned long pgoff);
102 int sys_execve(char *file, char **argv, char **env);
103 long sys_clone(unsigned long clone_flags, unsigned long newsp,
104 int *parent_tid, int *child_tid);
106 long sys_vfork(void);
107 int sys_pipe(unsigned long *fildes);
108 int sys_ptrace(long request, long pid, long addr, long data);
110 asmlinkage long sys_rt_sigaction(int sig,
111 const struct sigaction __user *act,
112 struct sigaction __user *oact,
117 /* Save the value of __KERNEL_SYSCALLS__, undefine it, include the underlying
118 * arch's unistd.h for the system call numbers, and restore the old
119 * __KERNEL_SYSCALLS__.
122 #ifdef __KERNEL_SYSCALLS__
123 #define __SAVE_KERNEL_SYSCALLS__ __KERNEL_SYSCALLS__
126 #undef __KERNEL_SYSCALLS__
127 #include "asm/arch/unistd.h"
129 #ifdef __KERNEL_SYSCALLS__
130 #define __KERNEL_SYSCALLS__ __SAVE_KERNEL_SYSCALLS__
136 * Overrides for Emacs so that we follow Linus's tabbing style.
137 * Emacs will notice this stuff at the end of the file and automatically
138 * adjust the settings for this buffer only. This must remain at the end
140 * ---------------------------------------------------------------------------
142 * c-file-style: "linux"