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[]);
15 #ifdef __KERNEL_SYSCALLS__
17 #include <linux/compiler.h>
18 #include <linux/types.h>
20 #define KERNEL_CALL(ret_t, sys, args...) \
21 mm_segment_t fs = get_fs(); \
28 static inline long open(const char *pathname, int flags, int mode)
30 KERNEL_CALL(int, sys_open, pathname, flags, mode)
33 static inline long dup(unsigned int fd)
35 KERNEL_CALL(int, sys_dup, fd);
38 static inline long close(unsigned int fd)
40 KERNEL_CALL(int, sys_close, fd);
43 static inline int execve(const char *filename, char *const argv[],
46 KERNEL_CALL(int, um_execve, filename, argv, envp);
49 static inline long waitpid(pid_t pid, unsigned int *status, int options)
51 KERNEL_CALL(pid_t, sys_wait4, pid, status, options, NULL)
54 static inline pid_t setsid(void)
56 KERNEL_CALL(pid_t, sys_setsid)
59 static inline long lseek(unsigned int fd, off_t offset, unsigned int whence)
61 KERNEL_CALL(long, sys_lseek, fd, offset, whence)
64 static inline int read(unsigned int fd, char * buf, int len)
66 KERNEL_CALL(int, sys_read, fd, buf, len)
69 static inline int write(unsigned int fd, char * buf, int len)
71 KERNEL_CALL(int, sys_write, fd, buf, len)
74 long sys_mmap2(unsigned long addr, unsigned long len,
75 unsigned long prot, unsigned long flags,
76 unsigned long fd, unsigned long pgoff);
77 int sys_execve(char *file, char **argv, char **env);
78 long sys_clone(unsigned long clone_flags, unsigned long newsp,
79 int *parent_tid, int *child_tid);
82 int sys_pipe(unsigned long *fildes);
83 int sys_ptrace(long request, long pid, long addr, long data);
85 asmlinkage long sys_rt_sigaction(int sig,
86 const struct sigaction __user *act,
87 struct sigaction __user *oact,
92 /* Save the value of __KERNEL_SYSCALLS__, undefine it, include the underlying
93 * arch's unistd.h for the system call numbers, and restore the old
94 * __KERNEL_SYSCALLS__.
97 #ifdef __KERNEL_SYSCALLS__
98 #define __SAVE_KERNEL_SYSCALLS__ __KERNEL_SYSCALLS__
101 #undef __KERNEL_SYSCALLS__
102 #include "asm/arch/unistd.h"
104 #ifdef __KERNEL_SYSCALLS__
105 #define __KERNEL_SYSCALLS__ __SAVE_KERNEL_SYSCALLS__
111 * Overrides for Emacs so that we follow Linus's tabbing style.
112 * Emacs will notice this stuff at the end of the file and automatically
113 * adjust the settings for this buffer only. This must remain at the end
115 * ---------------------------------------------------------------------------
117 * c-file-style: "linux"