syscalls.master revision 1.38.4.1 1 $NetBSD: syscalls.master,v 1.38.4.1 2008/11/20 03:03:05 snj Exp $
2
3 ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
4 ; (See syscalls.conf to see what it is processed into.)
5 ;
6 ; Fields: number type [type-dependent ...]
7 ; number system call number, must be in order
8 ; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
9 ; the compatibility options defined in syscalls.conf.
10 ;
11 ; types:
12 ; STD always included
13 ; OBSOL obsolete, not included in system
14 ; UNIMPL unimplemented, not included in system
15 ; NODEF included, but don't define the syscall number
16 ;
17 ; INDIR included, but don't define the syscall args structure
18 ; and allow it to be "really" varargs.
19 ;
20 ; The compat options are defined in the syscalls.conf file, and the
21 ; compat option name is prefixed to the syscall name. Other than
22 ; that, they're like NODEF (for 'compat' options), or STD (for
23 ; 'libcompat' options).
24 ;
25 ; The type-dependent arguments are as follows:
26 ; For STD, NODEF, NOARGS, and compat syscalls:
27 ; { pseudo-proto } [alias]
28 ; For other syscalls:
29 ; [comment]
30 ;
31 ; #ifdef's, etc. may be included, and are copied to the output files.
32 ; #include's are copied to the syscall names and switch definition files only.
33
34 #if defined(_KERNEL_OPT)
35 #include "opt_compat_43.h"
36 #endif
37
38 #include <sys/param.h>
39 #include <sys/poll.h>
40 #include <sys/systm.h>
41 #include <sys/signal.h>
42 #include <sys/mount.h>
43 #include <sys/syscallargs.h>
44
45 #include <machine/netbsd32_machdep.h>
46
47 #include <compat/netbsd32/netbsd32.h>
48 #include <compat/netbsd32/netbsd32_syscallargs.h>
49
50 #include <compat/linux32/common/linux32_types.h>
51 #include <compat/linux32/common/linux32_signal.h>
52 #include <compat/linux32/arch/amd64/linux32_missing.h>
53 #include <compat/linux32/linux32_syscallargs.h>
54
55 #include <compat/linux/common/linux_types.h>
56 #include <compat/linux/common/linux_mmap.h>
57 #include <compat/linux/common/linux_signal.h>
58 #include <compat/linux/common/linux_siginfo.h>
59 #include <compat/linux/common/linux_machdep.h>
60
61 #include <compat/linux/linux_syscallargs.h>
62
63 %%
64
65 0 NOARGS { int linux_sys_nosys(void); } syscall
66 1 NOARGS { int netbsd32_exit(int rval); }
67 2 NOARGS { int sys_fork(void); }
68 3 NOARGS { netbsd32_ssize_t netbsd32_read(int fd, \
69 netbsd32_voidp buf, netbsd32_size_t nbyte); }
70 4 NOARGS { netbsd32_ssize_t netbsd32_write(int fd, \
71 netbsd32_voidp buf, netbsd32_size_t nbyte); }
72 5 STD { int linux32_sys_open(netbsd32_charp path, int flags, \
73 int mode); }
74 6 NOARGS { int netbsd32_close(int fd); }
75 7 STD { int linux32_sys_waitpid(int pid, netbsd32_intp status, \
76 int options);}
77 8 STD { int linux32_sys_creat(netbsd32_charp path, int mode); }
78 9 NOARGS { int netbsd32_link(netbsd32_charp path, \
79 netbsd32_charp link); }
80 10 STD { int linux32_sys_unlink(netbsd32_charp path); }
81 11 NOARGS { int netbsd32_execve(netbsd32_charp path, \
82 netbsd32_charpp argp, netbsd32_charpp envp); }
83 12 NOARGS { int netbsd32_chdir(netbsd32_charp path); }
84 13 STD { int linux32_sys_time(linux32_timep_t t); }
85 14 STD { int linux32_sys_mknod(netbsd32_charp path, \
86 int mode, int dev); }
87 15 NOARGS { int netbsd32_chmod(netbsd32_charp path, int mode); }
88 16 STD { int linux32_sys_lchown16(netbsd32_charp path, \
89 linux32_uid16_t uid, linux32_gid16_t gid); }
90 17 STD { int linux32_sys_break(netbsd32_charp nsize); }
91 18 OBSOL ostat
92 19 NOARGS { netbsd32_long compat_43_netbsd32_olseek(int fd, \
93 netbsd32_long offset, int chence); }
94 20 STD { pid_t linux_sys_getpid(void); }
95 21 UNIMPL mount
96 22 UNIMPL umount
97 23 NOARGS linux_setuid16 { int netbsd32_setuid(uid_t uid); }
98 24 NOARGS linux_getuid16 { uid_t sys_getuid(void); }
99 25 STD { int linux32_sys_stime(linux32_timep_t t); }
100 26 STD { int linux32_sys_ptrace(int request, int pid, \
101 int addr, int data); }
102 27 STD { int linux32_sys_alarm(unsigned int secs); }
103 28 OBSOL ofstat
104 29 NOARGS { int linux_sys_pause(void); }
105 30 STD { int linux32_sys_utime(netbsd32_charp path, \
106 linux32_utimbufp_t times); }
107 31 OBSOL stty
108 32 OBSOL gtty
109 33 NOARGS { int netbsd32_access(netbsd32_charp path, \
110 int flags); }
111 34 STD { int linux32_sys_nice(int incr); }
112 35 OBSOL ftime
113 36 NOARGS { int sys_sync(void); }
114 37 STD { int linux32_sys_kill(int pid, int signum); }
115 38 NOARGS { int netbsd32___posix_rename(netbsd32_charp from, \
116 netbsd32_charp to); }
117 39 NOARGS { int netbsd32_mkdir(netbsd32_charp path, int mode); }
118 40 NOARGS { int netbsd32_rmdir(netbsd32_charp path); }
119 41 NOARGS { int netbsd32_dup(u_int fd); }
120 42 STD { int linux32_sys_pipe(netbsd32_intp fd); }
121 43 STD { int linux32_sys_times(linux32_tmsp_t tms); }
122 44 OBSOL prof
123 45 STD { int linux32_sys_brk(netbsd32_charp nsize); }
124 46 NOARGS linux_setgid16 { int netbsd32_setgid(gid_t gid); }
125 47 NOARGS linux_getgid16 { gid_t sys_getgid(void); }
126 48 STD { int linux32_sys_signal(int signum, \
127 linux32_handler_t handler); }
128 49 NOARGS linux_geteuid16 { uid_t sys_geteuid(void); }
129 50 NOARGS linux_getegid16 { gid_t sys_getegid(void); }
130 51 NOARGS { int netbsd32_acct(netbsd32_charp path); }
131 52 OBSOL phys
132 53 OBSOL lock
133 54 STD { int linux32_sys_ioctl(int fd, netbsd32_u_long com, \
134 netbsd32_charp data); }
135 55 STD { int linux32_sys_fcntl(int fd, \
136 int cmd, netbsd32_voidp arg); }
137 56 OBSOL mpx
138 57 NOARGS { int netbsd32_setpgid(int pid, int pgid); }
139 58 OBSOL ulimit
140 59 STD { int linux32_sys_oldolduname( \
141 linux32_oldold_utsnamep_t up); }
142 60 NOARGS { int netbsd32_umask(int newmask); }
143 61 NOARGS { int netbsd32_chroot(netbsd32_charp path); }
144 62 UNIMPL ustat
145 63 NOARGS { int netbsd32_dup2(int from, int to); }
146 64 STD { pid_t linux_sys_getppid(void); }
147 65 NOARGS { int sys_getpgrp(void); }
148 66 NOARGS { int sys_setsid(void); }
149 67 UNIMPL sigaction
150 68 UNIMPL siggetmask
151 69 UNIMPL sigsetmask
152 70 STD { int linux32_sys_setreuid16(linux32_uid16_t ruid, \
153 linux32_uid16_t euid); }
154 71 STD { int linux32_sys_setregid16(linux32_gid16_t rgid, \
155 linux32_gid16_t egid); }
156 72 UNIMPL sigsuspend
157 73 UNIMPL sigpending
158 74 NOARGS { int compat_43_netbsd32_osethostname(netbsd32_charp hostname, \
159 u_int len); }
160 75 STD { int linux32_sys_setrlimit(u_int which, \
161 netbsd32_orlimitp_t rlp); }
162 76 STD { int linux32_sys_getrlimit(u_int which, \
163 netbsd32_orlimitp_t rlp); }
164 77 NOARGS { int netbsd32_getrusage(int who, \
165 netbsd32_rusagep_t rusage); }
166 78 STD { int linux32_sys_gettimeofday(netbsd32_timevalp_t tp, \
167 netbsd32_timezonep_t tzp); }
168 79 STD { int linux32_sys_settimeofday(netbsd32_timevalp_t tp, \
169 netbsd32_timezonep_t tzp); }
170 80 STD { int linux32_sys_getgroups16(int gidsetsize, \
171 linux32_gid16p_t gidset); }
172 81 STD { int linux32_sys_setgroups16(int gidsetsize, \
173 linux32_gid16p_t gidset); }
174 82 STD { int linux32_sys_oldselect(linux32_oldselectp_t lsp); }
175 83 NOARGS { int netbsd32_symlink(netbsd32_charp path, \
176 netbsd32_charp link); }
177 84 NOARGS { int compat_43_netbsd32_lstat43(netbsd32_charp \
178 path, netbsd32_stat43p_t ub); }
179 85 NOARGS { int netbsd32_readlink(netbsd32_charp name, \
180 netbsd32_charp buf, netbsd32_size_t count); }
181 86 UNIMPL uselib
182 87 STD { int linux32_sys_swapon(netbsd32_charp name); }
183 88 STD { int linux32_sys_reboot(int magic1, int magic2, int cmd, \
184 netbsd32_voidp arg); }
185 89 STD { int linux32_sys_readdir(int fd, netbsd32_voidp dent, \
186 unsigned int count); }
187 90 STD { int linux32_sys_old_mmap(linux32_oldmmapp lmp); }
188 91 NOARGS { int netbsd32_munmap(netbsd32_voidp addr, \
189 netbsd32_size_t len); }
190 92 NOARGS { int compat_43_netbsd32_otruncate(netbsd32_charp path, \
191 netbsd32_long length); }
192 93 NOARGS { int compat_43_netbsd32_oftruncate(int fd, \
193 netbsd32_long length); }
194 94 NOARGS { int netbsd32_fchmod(int fd, int mode); }
195 95 STD { int linux32_sys_fchown16(int fd, linux32_uid16_t uid, \
196 linux32_gid16_t gid); }
197 96 STD { int linux32_sys_getpriority(int which, int who); }
198 97 NOARGS { int netbsd32_setpriority(int which, int who, int prio); }
199 98 UNIMPL profil
200 99 STD { int linux32_sys_statfs(netbsd32_charp path, \
201 linux32_statfsp sp); }
202 100 UNIMPL fstatfs
203 101 UNIMPL ioperm
204 102 STD { int linux32_sys_socketcall(int what, netbsd32_voidp args); }
205 103 UNIMPL syslog
206 104 NOARGS { int netbsd32_setitimer(int which, \
207 netbsd32_itimervalp_t itv, netbsd32_itimervalp_t oitv); }
208 105 NOARGS { int netbsd32_getitimer(int which, \
209 netbsd32_itimervalp_t itv); }
210 106 UNIMPL stat
211 107 UNIMPL lstat
212 108 UNIMPL fstat
213 109 STD { int linux32_sys_olduname(linux32_oldutsnamep_t up); }
214 110 UNIMPL iopl
215 111 UNIMPL vhangup
216 112 UNIMPL idle
217 113 UNIMPL vm86old
218 114 STD { int linux32_sys_wait4(int pid, netbsd32_intp status, \
219 int options, netbsd32_rusagep_t rusage); }
220 115 STD { int linux32_sys_swapoff(netbsd32_charp path); }
221 116 STD { int linux32_sys_sysinfo(linux32_sysinfop_t arg); }
222 117 STD { int linux32_sys_ipc(int what, int a1, int a2, int a3, \
223 netbsd32_voidp ptr); }
224 118 NOARGS { int netbsd32_fsync(int fd); }
225 119 STD { int linux32_sys_sigreturn(linux32_sigcontextp_t scp); }
226 120 STD { int linux32_sys_clone(int flags, netbsd32_voidp stack); }
227 121 UNIMPL setdomainname
228 122 STD { int linux32_sys_uname(linux32_utsnamep up); }
229 123 UNIMPL modify_ldt
230 124 UNIMPL adjtimex
231 125 STD { int linux32_sys_mprotect(netbsd32_voidp start, \
232 netbsd32_size_t len, int prot); }
233 126 UNIMPL sigprocmask
234 127 UNIMPL create_module
235 128 UNIMPL init_module
236 129 UNIMPL delete_module
237 130 UNIMPL get_kernel_syms
238 131 UNIMPL quotactl
239 132 NOARGS { int netbsd32_getpgid(pid_t pid); }
240 133 NOARGS { int netbsd32_fchdir(int fd); }
241 134 UNIMPL bdflush
242 135 UNIMPL sysfs
243 136 UNIMPL personality
244 137 UNIMPL afs_syscall
245 138 NOARGS setfsuid16 { int linux32_sys_setfsuid(uid_t uid); }
246 139 NOARGS setfsgid16 { int linux32_sys_setfsgid(gid_t gid); }
247 140 STD { int linux32_sys_llseek(int fd, u_int32_t ohigh, \
248 u_int32_t olow, netbsd32_caddr_t res, int whence); }
249 141 STD { int linux32_sys_getdents(int fd, \
250 linux32_direntp_t dent, unsigned int count); }
251 142 STD { int linux32_sys_select(int nfds, \
252 netbsd32_fd_setp_t readfds, \
253 netbsd32_fd_setp_t writefds, \
254 netbsd32_fd_setp_t exceptfds, \
255 netbsd32_timevalp_t timeout); }
256 143 NOARGS { int netbsd32_flock(int fd, int how); }
257 144 NOARGS { int netbsd32___msync13(netbsd32_voidp addr, \
258 netbsd32_size_t len, int flags); }
259 145 NOARGS { int netbsd32_readv(int fd, \
260 netbsd32_iovecp_t iovp, int iovcnt); }
261 146 NOARGS { netbsd32_ssize_t netbsd32_writev(int fd, \
262 netbsd32_iovecp_t iovp, int iovcnt); }
263 147 NOARGS { pid_t netbsd32_getsid(pid_t pid); }
264 148 STD { int linux32_sys_fdatasync(int fd); }
265 149 STD { int linux32_sys___sysctl(linux32___sysctlp_t lsp); }
266 150 NOARGS { int netbsd32_mlock(netbsd32_voidp addr, \
267 netbsd32_size_t len); }
268 151 NOARGS { int netbsd32_munlock(netbsd32_voidp addr, \
269 netbsd32_size_t len); }
270 152 NOARGS { int netbsd32_mlockall(int flags); }
271 153 NOARGS { int sys_munlockall(void); }
272 154 UNIMPL sched_setparam
273 155 STD { int linux32_sys_sched_getparam(pid_t pid, \
274 linux32_sched_paramp_t sp); }
275 156 STD { int linux32_sys_sched_setscheduler(pid_t pid, \
276 int policy, linux32_sched_paramp_t sp); }
277 157 STD { int linux32_sys_sched_getscheduler(pid_t pid); }
278 158 NOARGS { int linux_sys_sched_yield(void); }
279 159 UNIMPL sched_get_priority_max
280 160 UNIMPL sched_get_priority_min
281 161 UNIMPL sched_rr_get_interval
282 162 STD { int linux32_sys_nanosleep(linux32_timespecp_t rqtp, \
283 linux32_timespecp_t rmtp); }
284 163 STD { int linux32_sys_mremap(netbsd32_voidp old_address, \
285 netbsd32_size_t old_size, netbsd32_size_t new_size, \
286 netbsd32_u_long flags); }
287 164 STD { int linux32_sys_setresuid16(linux32_uid16_t ruid, \
288 linux32_uid16_t euid, linux32_uid16_t suid); }
289 165 STD { int linux32_sys_getresuid16(linux32_uid16p_t ruid, \
290 linux32_uid16p_t euid, linux32_uid16p_t suid); }
291 166 UNIMPL vm86
292 167 UNIMPL query_module
293 168 NOARGS { int netbsd32_poll(netbsd32_pollfdp_t fds, u_int nfds, \
294 int timeout); }
295 169 UNIMPL nfsservctl
296 170 STD { int linux32_sys_setresgid16(linux32_gid16_t rgid, \
297 linux32_gid16_t egid, linux32_gid16_t sgid); }
298 171 STD { int linux32_sys_getresgid16(linux32_gid16p_t rgid, \
299 linux32_gid16p_t egid, linux32_gid16p_t sgid); }
300 172 UNIMPL prctl
301 173 STD { int linux32_sys_rt_sigreturn(linux32_ucontextp_t ucp); }
302 174 STD { int linux32_sys_rt_sigaction(int signum, \
303 linux32_sigactionp_t nsa, \
304 linux32_sigactionp_t osa, \
305 netbsd32_size_t sigsetsize); }
306 175 STD { int linux32_sys_rt_sigprocmask(int how, \
307 linux32_sigsetp_t set, \
308 linux32_sigsetp_t oset, \
309 netbsd32_size_t sigsetsize); }
310 176 STD { int linux32_sys_rt_sigpending(linux32_sigsetp_t set, \
311 netbsd32_size_t sigsetsize); }
312 177 UNIMPL rt_sigtimedwait
313 178 UNIMPL rt_queueinfo
314 179 STD { int linux32_sys_rt_sigsuspend(linux32_sigsetp_t unewset, \
315 netbsd32_size_t sigsetsize); }
316 180 STD { netbsd32_ssize_t linux32_sys_pread(int fd, \
317 netbsd32_voidp buf, netbsd32_size_t nbyte, \
318 linux32_off_t offset); }
319 181 STD { netbsd32_ssize_t linux32_sys_pwrite(int fd, \
320 netbsd32_voidp buf, netbsd32_size_t nbyte, \
321 linux32_off_t offset); }
322 182 STD { int linux32_sys_chown16(netbsd32_charp path, \
323 linux32_uid16_t uid, linux32_gid16_t gid); }
324 183 NOARGS { int netbsd32___getcwd(netbsd32_charp bufp, \
325 netbsd32_size_t length); }
326 184 UNIMPL capget
327 185 UNIMPL capset
328 186 UNIMPL sigaltstack
329 187 UNIMPL sendfile
330 188 UNIMPL getpmsg
331 189 UNIMPL putpmsg
332 190 NOARGS { int sys___vfork14(void); }
333 191 STD { int linux32_sys_ugetrlimit(int which, \
334 netbsd32_orlimitp_t rlp); }
335 192 STD { linux32_off_t linux32_sys_mmap2(netbsd32_u_long addr, \
336 netbsd32_size_t len, int prot, int flags, int fd, \
337 linux32_off_t offset); }
338 193 UNIMPL truncate64
339 194 UNIMPL ftruncate64
340 195 STD { int linux32_sys_stat64(netbsd32_charp path, \
341 linux32_stat64p sp); }
342 196 STD { int linux32_sys_lstat64(netbsd32_charp path, \
343 linux32_stat64p sp); }
344 197 STD { int linux32_sys_fstat64(int fd, \
345 linux32_stat64p sp); }
346 198 NOARGS { int netbsd32___posix_lchown(netbsd32_charp path, \
347 uid_t uid, gid_t gid); }
348 199 NOARGS { uid_t sys_getuid(void); }
349 200 NOARGS { gid_t sys_getgid(void); }
350 201 NOARGS { uid_t sys_geteuid(void); }
351 202 NOARGS { gid_t sys_getegid(void); }
352 203 NOARGS { int netbsd32_setreuid(uid_t ruid, uid_t euid); }
353 204 NOARGS { int netbsd32_setregid(gid_t rgid, gid_t egid); }
354 205 NOARGS { int netbsd32_getgroups(int gidsetsize, \
355 netbsd32_gid_tp gidset); }
356 206 NOARGS { int netbsd32_setgroups(int gidsetsize, \
357 netbsd32_gid_tp gidset); }
358 207 NOARGS { int netbsd32___posix_fchown(int fd, uid_t uid, gid_t gid); }
359 208 STD { int linux32_sys_setresuid(uid_t ruid, uid_t euid, \
360 uid_t suid); }
361 209 UNIMPL getresuid
362 210 STD { int linux32_sys_setresgid(gid_t rgid, gid_t egid, \
363 gid_t sgid); }
364 211 UNIMPL getresgid
365 212 NOARGS { int netbsd32___posix_chown(netbsd32_charp path, \
366 uid_t uid, gid_t gid); }
367 213 NOARGS { int netbsd32_setuid(uid_t uid); }
368 214 NOARGS { int netbsd32_setgid(gid_t gid); }
369 215 STD { int linux32_sys_setfsuid(uid_t uid); }
370 216 STD { int linux32_sys_setfsgid(gid_t gid); }
371 217 UNIMPL pivot_root
372 218 UNIMPL mincore
373 219 NOARGS { int netbsd32_madvise(netbsd32_voidp addr, \
374 netbsd32_size_t len, int behav); }
375 220 STD { int linux32_sys_getdents64(int fd, \
376 linux32_dirent64p_t dent, unsigned int count); }
377 ; fcntl64() - Exactly the same as fcntl()
378 #define linux32_sys_fcntl64 linux32_sys_fcntl
379 #define linux32_sys_fcntl64_args linux32_sys_fcntl_args
380 221 NOARGS { int linux32_sys_fcntl64(int fd, \
381 int cmd, netbsd32_voidp arg); }
382 222 UNIMPL /* unused */
383 223 UNIMPL /* unused */
384 224 STD { pid_t linux_sys_gettid(void); }
385 225 UNIMPL readahead
386 226 UNIMPL setxattr
387 227 UNIMPL lsetxattr
388 228 UNIMPL fsetxattr
389 229 UNIMPL getxattr
390 230 UNIMPL lgetxattr
391 231 UNIMPL fgetxattr
392 232 UNIMPL listxattr
393 233 UNIMPL llistxattr
394 234 UNIMPL flistxattr
395 235 UNIMPL removexattr
396 236 UNIMPL lremovexattr
397 237 UNIMPL fremovexattr
398 238 UNIMPL tkill
399 239 UNIMPL sendfile64
400 240 UNIMPL futex
401 241 UNIMPL sched_setaffinity
402 242 UNIMPL sched_getaffinity
403 243 UNIMPL set_thread_area
404 244 UNIMPL get_thread_area
405 245 UNIMPL io_setup
406 246 UNIMPL io_destroy
407 247 UNIMPL io_getevents
408 248 UNIMPL io_submit
409 249 UNIMPL io_cancel
410 250 UNIMPL fadvise64
411 251 UNIMPL /* unused */
412 252 STD { int linux32_sys_exit_group(int error_code); }
413 253 UNIMPL lookup_dcookie
414 254 UNIMPL epoll_create
415 255 UNIMPL epoll_ctl
416 256 UNIMPL epoll_wait
417 257 UNIMPL remap_file_pages
418 258 UNIMPL set_tid_address
419 259 UNIMPL timer_create
420 260 UNIMPL timer_settime
421 261 UNIMPL timer_gettime
422 262 UNIMPL timer_getoverrun
423 263 UNIMPL timer_delete
424 264 STD { int linux32_sys_clock_settime(clockid_t which, \
425 linux32_timespecp_t tp); }
426 265 STD { int linux32_sys_clock_gettime(clockid_t which, \
427 linux32_timespecp_t tp); }
428 266 STD { int linux32_sys_clock_getres(clockid_t which, \
429 linux32_timespecp_t tp); }
430 267 UNIMPL clock_nanosleep
431 268 UNIMPL statfs64
432 269 UNIMPL fstatfs64
433 270 UNIMPL tgkill
434 271 UNIMPL utimes
435 272 UNIMPL fadvise64_64
436 273 UNIMPL vserver
437 274 UNIMPL mbind
438 275 UNIMPL get_mempolicy
439 276 UNIMPL set_mempolicy
440 277 UNIMPL mq_open
441 278 UNIMPL mq_unlink
442 279 UNIMPL mq_timedsend
443 280 UNIMPL mq_timedreceive
444 281 UNIMPL mq_notify
445 282 UNIMPL mq_getsetattr
446 283 UNIMPL kexec_load
447