14 #define __NR_waitpid 7
17 #define __NR_unlink 10
18 #define __NR_execve 11
23 #define __NR_lchown 16
26 #define __NR_getpid 20
28 #define __NR_oldumount 22
29 #define __NR_setuid 23
30 #define __NR_getuid 24
32 #define __NR_ptrace 26
37 #define __NR_access 33
41 #define __NR_rename 38
48 #define __NR_setgid 46
49 #define __NR_getgid 47
50 #define __NR_signal 48
51 #define __NR_geteuid 49
52 #define __NR_getegid 50
54 #define __NR_umount 52
57 #define __NR_setpgid 57
58 #define __NR_olduname 59
60 #define __NR_chroot 61
63 #define __NR_getppid 64
64 #define __NR_getpgrp 65
65 #define __NR_setsid 66
66 #define __NR_sigaction 67
67 #define __NR_sgetmask 68
68 #define __NR_ssetmask 69
69 #define __NR_setreuid 70
70 #define __NR_setregid 71
71 #define __NR_sigsuspend 72
72 #define __NR_sigpending 73
73 #define __NR_sethostname 74
74 #define __NR_setrlimit 75
75 #define __NR_getrlimit 76
76 #define __NR_getrusage 77
77 #define __NR_gettimeofday 78
78 #define __NR_settimeofday 79
79 #define __NR_getgroups 80
80 #define __NR_setgroups 81
81 #define __NR_symlink 83
83 #define __NR_readlink 85
84 #define __NR_uselib 86
85 #define __NR_swapon 87
86 #define __NR_reboot 88
87 #define __NR_readdir 89
89 #define __NR_munmap 91
90 #define __NR_truncate 92
91 #define __NR_ftruncate 93
92 #define __NR_fchmod 94
93 #define __NR_fchown 95
94 #define __NR_getpriority 96
95 #define __NR_setpriority 97
96 #define __NR_statfs 99
97 #define __NR_fstatfs 100
98 #define __NR_ioperm 101
99 #define __NR_socketcall 102
100 #define __NR_syslog 103
101 #define __NR_setitimer 104
102 #define __NR_getitimer 105
103 #define __NR_newstat 106
104 #define __NR_newlstat 107
105 #define __NR_newfstat 108
106 #define __NR_uname 109
107 #define __NR_iopl 110
108 #define __NR_vhangup 111
109 #define __NR_idle 112
110 #define __NR_vm86old 113
111 #define __NR_wait4 114
112 #define __NR_swapoff 115
113 #define __NR_sysinfo 116
115 #define __NR_fsync 118
116 #define __NR_sigreturn 119
117 #define __NR_clone 120
118 #define __NR_setdomainname 121
119 #define __NR_newuname 122
120 #define __NR_modify_ldt 123
121 #define __NR_adjtimex 124
122 #define __NR_mprotect 125
123 #define __NR_sigprocmask 126
124 #define __NR_create_module 127
125 #define __NR_init_module 128
126 #define __NR_delete_module 129
127 #define __NR_get_kernel_syms 130
128 #define __NR_quotactl 131
129 #define __NR_getpgid 132
130 #define __NR_fchdir 133
131 #define __NR_bdflush 134
132 #define __NR_sysfs 135
133 #define __NR_personality 136
134 #define __NR_setfsuid 138
135 #define __NR_setfsgid 139
136 #define __NR_llseek 140
137 #define __NR_getdents 141
138 #define __NR_select 142
139 #define __NR_flock 143
140 #define __NR_msync 144
141 #define __NR_readv 145
142 #define __NR_writev 146
143 #define __NR_getsid 147
144 #define __NR_fdatasync 148
145 #define __NR_sysctl 149
146 #define __NR_mlock 150
147 #define __NR_munlock 151
148 #define __NR_mlockall 152
149 #define __NR_munlockall 153
150 #define __NR_sched_setparam 154
151 #define __NR_sched_getparam 155
152 #define __NR_sched_setscheduler 156
153 #define __NR_sched_getscheduler 157
154 #define __NR_sched_yield 158
155 #define __NR_sched_get_priority_max 159
156 #define __NR_sched_get_priority_min 160
157 #define __NR_sched_rr_get_interval 161
158 #define __NR_nanosleep 162
159 #define __NR_mremap 163
160 #define __NR_setresuid 164
161 #define __NR_getresuid 165
162 #define __NR_vm86 166
163 #define __NR_query_module 167
164 #define __NR_poll 168
165 #define __NR_nfsservctl 169
166 #define __NR_setresgid 170
167 #define __NR_getresgid 171
168 #define __NR_prctl 172
169 #define __NR_rt_sigreturn 173
170 #define __NR_rt_sigaction 174
171 #define __NR_rt_sigprocmask 175
172 #define __NR_rt_sigpending 176
173 #define __NR_rt_sigtimedwait 177
174 #define __NR_rt_sigqueueinfo 178
175 #define __NR_rt_sigsuspend 179
176 #define __NR_pread 180
177 #define __NR_pwrite 181
178 #define __NR_chown 182
179 #define __NR_getcwd 183
180 #define __NR_capget 184
181 #define __NR_capset 185
182 #define __NR_sigaltstack 186
183 #define __NR_sendfile 187
184 #define __NR_waitperiod 188
185 #define __NR_msgctl 189
186 #define __NR_msgget 190
187 #define __NR_msgrcv 191
188 #define __NR_msgsnd 192
189 #define __NR_semctl 193
190 #define __NR_semget 194
191 #define __NR_semop 195
192 #define __NR_shmat 196
193 #define __NR_shmctl 197
194 #define __NR_shmdt 198
195 #define __NR_shmget 199
196 #define SYSCALL_NUMBER 200
201 #define __syscall_return(type, res) \
203 if ((unsigned int)(res) >= (unsigned int)(-125)) { \
207 return (type)(res); \
222 #define __inline_syscall0(res, name) \
223 __asm__ __volatile__("int $0x80" \
228 #define __inline_syscall1(res, name, arg1) \
229 __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
231 : "0"(__NR_##name), "ri"(arg1) \
235 #define __inline_syscall2(res, name, arg1, arg2) \
236 __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
238 : "0"(__NR_##name), "ri"(arg1), "c"(arg2) \
242 #define __inline_syscall3(res, name, arg1, arg2, arg3) \
243 __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
245 : "0"(__NR_##name), "ri"(arg1), "c"(arg2), "d"(arg3) \
249 #define __inline_syscall4(res, name, arg1, arg2, arg3, arg4) \
250 __asm__ __volatile__("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
252 : "0"(__NR_##name), "ri"(arg1), "c"(arg2), "d"(arg3), "S"(arg4) \
256 #define __inline_syscall5(res, name, arg1, arg2, arg3, arg4, arg5) \
257 __asm__ __volatile__("push %%ebx; movl %2,%%ebx; movl %1,%%eax; " \
258 "int $0x80; pop %%ebx" \
260 : "i"(__NR_##name), "ri"(arg1), "c"(arg2), "d"(arg3), "S"(arg4), "D"(arg5) \
264 #define _syscall0(type, name) \
268 __inline_syscall0(__res, name); \
269 __syscall_return(type, __res); \
273 #define _syscall1(type, name, type1, arg1) \
274 type name(type1 arg1) \
277 __inline_syscall1(__res, name, arg1); \
278 __syscall_return(type, __res); \
282 #define _syscall2(type, name, type1, arg1, type2, arg2) \
283 type name(type1 arg1, type2 arg2) \
286 __inline_syscall2(__res, name, arg1, arg2); \
287 __syscall_return(type, __res); \
291 #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
292 type name(type1 arg1, type2 arg2, type3 arg3) \
295 __inline_syscall3(__res, name, arg1, arg2, arg3); \
296 __syscall_return(type, __res); \
300 #define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \
301 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
304 __inline_syscall4(__res, name, arg1, arg2, arg3, arg4); \
305 __syscall_return(type, __res); \
309 #define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \
310 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
313 __inline_syscall5(__res, name, arg1, arg2, arg3, arg4, arg5); \
314 __syscall_return(type, __res); \
318 #define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6) \
319 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
322 unsigned args[6] = { 0 }; \
323 args[0] = (unsigned)arg1; \
324 args[1] = (unsigned)arg2; \
325 args[2] = (unsigned)arg3; \
326 args[3] = (unsigned)arg4; \
327 args[4] = (unsigned)arg5; \
328 args[5] = (unsigned)arg6; \
329 __inline_syscall1(__res, name, args); \
330 __syscall_return(type, __res); \