syscalls.master revision 1.38.4.2 1 $NetBSD: syscalls.master,v 1.38.4.2 2015/03/18 17:20:09 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 STD { int linux32_sys_fstatfs(int fd, linux32_statfsp sp); }
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 STD { int linux32_sys_stat(netbsd32_charp path, \
211 linux32_statp sp); }
212 107 STD { int linux32_sys_lstat(netbsd32_charp path, \
213 linux32_statp sp); }
214 108 STD { int linux32_sys_fstat(int fd, linux32_statp sp); }
215 109 STD { int linux32_sys_olduname(linux32_oldutsnamep_t up); }
216 110 UNIMPL iopl
217 111 UNIMPL vhangup
218 112 UNIMPL idle
219 113 UNIMPL vm86old
220 114 STD { int linux32_sys_wait4(int pid, netbsd32_intp status, \
221 int options, netbsd32_rusagep_t rusage); }
222 115 STD { int linux32_sys_swapoff(netbsd32_charp path); }
223 116 STD { int linux32_sys_sysinfo(linux32_sysinfop_t arg); }
224 117 STD { int linux32_sys_ipc(int what, int a1, int a2, int a3, \
225 netbsd32_voidp ptr); }
226 118 NOARGS { int netbsd32_fsync(int fd); }
227 119 STD { int linux32_sys_sigreturn(linux32_sigcontextp_t scp); }
228 120 STD { int linux32_sys_clone(int flags, netbsd32_voidp stack); }
229 121 UNIMPL setdomainname
230 122 STD { int linux32_sys_uname(linux32_utsnamep up); }
231 123 UNIMPL modify_ldt
232 124 UNIMPL adjtimex
233 125 STD { int linux32_sys_mprotect(netbsd32_voidp start, \
234 netbsd32_size_t len, int prot); }
235 126 UNIMPL sigprocmask
236 127 UNIMPL create_module
237 128 UNIMPL init_module
238 129 UNIMPL delete_module
239 130 UNIMPL get_kernel_syms
240 131 UNIMPL quotactl
241 132 NOARGS { int netbsd32_getpgid(pid_t pid); }
242 133 NOARGS { int netbsd32_fchdir(int fd); }
243 134 UNIMPL bdflush
244 135 UNIMPL sysfs
245 136 UNIMPL personality
246 137 UNIMPL afs_syscall
247 138 NOARGS setfsuid16 { int linux32_sys_setfsuid(uid_t uid); }
248 139 NOARGS setfsgid16 { int linux32_sys_setfsgid(gid_t gid); }
249 140 STD { int linux32_sys_llseek(int fd, u_int32_t ohigh, \
250 u_int32_t olow, netbsd32_caddr_t res, int whence); }
251 141 STD { int linux32_sys_getdents(int fd, \
252 linux32_direntp_t dent, unsigned int count); }
253 142 STD { int linux32_sys_select(int nfds, \
254 netbsd32_fd_setp_t readfds, \
255 netbsd32_fd_setp_t writefds, \
256 netbsd32_fd_setp_t exceptfds, \
257 netbsd32_timevalp_t timeout); }
258 143 NOARGS { int netbsd32_flock(int fd, int how); }
259 144 NOARGS { int netbsd32___msync13(netbsd32_voidp addr, \
260 netbsd32_size_t len, int flags); }
261 145 NOARGS { int netbsd32_readv(int fd, \
262 netbsd32_iovecp_t iovp, int iovcnt); }
263 146 NOARGS { netbsd32_ssize_t netbsd32_writev(int fd, \
264 netbsd32_iovecp_t iovp, int iovcnt); }
265 147 NOARGS { pid_t netbsd32_getsid(pid_t pid); }
266 148 STD { int linux32_sys_fdatasync(int fd); }
267 149 STD { int linux32_sys___sysctl(linux32___sysctlp_t lsp); }
268 150 NOARGS { int netbsd32_mlock(netbsd32_voidp addr, \
269 netbsd32_size_t len); }
270 151 NOARGS { int netbsd32_munlock(netbsd32_voidp addr, \
271 netbsd32_size_t len); }
272 152 NOARGS { int netbsd32_mlockall(int flags); }
273 153 NOARGS { int sys_munlockall(void); }
274 154 UNIMPL sched_setparam
275 155 STD { int linux32_sys_sched_getparam(pid_t pid, \
276 linux32_sched_paramp_t sp); }
277 156 STD { int linux32_sys_sched_setscheduler(pid_t pid, \
278 int policy, linux32_sched_paramp_t sp); }
279 157 STD { int linux32_sys_sched_getscheduler(pid_t pid); }
280 158 NOARGS { int linux_sys_sched_yield(void); }
281 159 UNIMPL sched_get_priority_max
282 160 UNIMPL sched_get_priority_min
283 161 UNIMPL sched_rr_get_interval
284 162 STD { int linux32_sys_nanosleep(linux32_timespecp_t rqtp, \
285 linux32_timespecp_t rmtp); }
286 163 STD { int linux32_sys_mremap(netbsd32_voidp old_address, \
287 netbsd32_size_t old_size, netbsd32_size_t new_size, \
288 netbsd32_u_long flags); }
289 164 STD { int linux32_sys_setresuid16(linux32_uid16_t ruid, \
290 linux32_uid16_t euid, linux32_uid16_t suid); }
291 165 STD { int linux32_sys_getresuid16(linux32_uid16p_t ruid, \
292 linux32_uid16p_t euid, linux32_uid16p_t suid); }
293 166 UNIMPL vm86
294 167 UNIMPL query_module
295 168 NOARGS { int netbsd32_poll(netbsd32_pollfdp_t fds, u_int nfds, \
296 int timeout); }
297 169 UNIMPL nfsservctl
298 170 STD { int linux32_sys_setresgid16(linux32_gid16_t rgid, \
299 linux32_gid16_t egid, linux32_gid16_t sgid); }
300 171 STD { int linux32_sys_getresgid16(linux32_gid16p_t rgid, \
301 linux32_gid16p_t egid, linux32_gid16p_t sgid); }
302 172 UNIMPL prctl
303 173 STD { int linux32_sys_rt_sigreturn(linux32_ucontextp_t ucp); }
304 174 STD { int linux32_sys_rt_sigaction(int signum, \
305 linux32_sigactionp_t nsa, \
306 linux32_sigactionp_t osa, \
307 netbsd32_size_t sigsetsize); }
308 175 STD { int linux32_sys_rt_sigprocmask(int how, \
309 linux32_sigsetp_t set, \
310 linux32_sigsetp_t oset, \
311 netbsd32_size_t sigsetsize); }
312 176 STD { int linux32_sys_rt_sigpending(linux32_sigsetp_t set, \
313 netbsd32_size_t sigsetsize); }
314 177 UNIMPL rt_sigtimedwait
315 178 UNIMPL rt_queueinfo
316 179 STD { int linux32_sys_rt_sigsuspend(linux32_sigsetp_t unewset, \
317 netbsd32_size_t sigsetsize); }
318 180 STD { netbsd32_ssize_t linux32_sys_pread(int fd, \
319 netbsd32_voidp buf, netbsd32_size_t nbyte, \
320 linux32_off_t offset); }
321 181 STD { netbsd32_ssize_t linux32_sys_pwrite(int fd, \
322 netbsd32_voidp buf, netbsd32_size_t nbyte, \
323 linux32_off_t offset); }
324 182 STD { int linux32_sys_chown16(netbsd32_charp path, \
325 linux32_uid16_t uid, linux32_gid16_t gid); }
326 183 NOARGS { int netbsd32___getcwd(netbsd32_charp bufp, \
327 netbsd32_size_t length); }
328 184 UNIMPL capget
329 185 UNIMPL capset
330 186 UNIMPL sigaltstack
331 187 UNIMPL sendfile
332 188 UNIMPL getpmsg
333 189 UNIMPL putpmsg
334 190 NOARGS { int sys___vfork14(void); }
335 191 STD { int linux32_sys_ugetrlimit(int which, \
336 netbsd32_orlimitp_t rlp); }
337 192 STD { linux32_off_t linux32_sys_mmap2(netbsd32_u_long addr, \
338 netbsd32_size_t len, int prot, int flags, int fd, \
339 linux32_off_t offset); }
340 193 UNIMPL truncate64
341 194 UNIMPL ftruncate64
342 195 STD { int linux32_sys_stat64(netbsd32_charp path, \
343 linux32_stat64p sp); }
344 196 STD { int linux32_sys_lstat64(netbsd32_charp path, \
345 linux32_stat64p sp); }
346 197 STD { int linux32_sys_fstat64(int fd, \
347 linux32_stat64p sp); }
348 198 NOARGS { int netbsd32___posix_lchown(netbsd32_charp path, \
349 uid_t uid, gid_t gid); }
350 199 NOARGS { uid_t sys_getuid(void); }
351 200 NOARGS { gid_t sys_getgid(void); }
352 201 NOARGS { uid_t sys_geteuid(void); }
353 202 NOARGS { gid_t sys_getegid(void); }
354 203 NOARGS { int netbsd32_setreuid(uid_t ruid, uid_t euid); }
355 204 NOARGS { int netbsd32_setregid(gid_t rgid, gid_t egid); }
356 205 NOARGS { int netbsd32_getgroups(int gidsetsize, \
357 netbsd32_gid_tp gidset); }
358 206 NOARGS { int netbsd32_setgroups(int gidsetsize, \
359 netbsd32_gid_tp gidset); }
360 207 NOARGS { int netbsd32___posix_fchown(int fd, uid_t uid, gid_t gid); }
361 208 STD { int linux32_sys_setresuid(uid_t ruid, uid_t euid, \
362 uid_t suid); }
363 209 UNIMPL getresuid
364 210 STD { int linux32_sys_setresgid(gid_t rgid, gid_t egid, \
365 gid_t sgid); }
366 211 UNIMPL getresgid
367 212 NOARGS { int netbsd32___posix_chown(netbsd32_charp path, \
368 uid_t uid, gid_t gid); }
369 213 NOARGS { int netbsd32_setuid(uid_t uid); }
370 214 NOARGS { int netbsd32_setgid(gid_t gid); }
371 215 STD { int linux32_sys_setfsuid(uid_t uid); }
372 216 STD { int linux32_sys_setfsgid(gid_t gid); }
373 217 UNIMPL pivot_root
374 218 UNIMPL mincore
375 219 NOARGS { int netbsd32_madvise(netbsd32_voidp addr, \
376 netbsd32_size_t len, int behav); }
377 220 STD { int linux32_sys_getdents64(int fd, \
378 linux32_dirent64p_t dent, unsigned int count); }
379 ; fcntl64() - Exactly the same as fcntl()
380 #define linux32_sys_fcntl64 linux32_sys_fcntl
381 #define linux32_sys_fcntl64_args linux32_sys_fcntl_args
382 221 NOARGS { int linux32_sys_fcntl64(int fd, \
383 int cmd, netbsd32_voidp arg); }
384 222 UNIMPL /* unused */
385 223 UNIMPL /* unused */
386 224 STD { pid_t linux_sys_gettid(void); }
387 225 UNIMPL readahead
388 226 UNIMPL setxattr
389 227 UNIMPL lsetxattr
390 228 UNIMPL fsetxattr
391 229 UNIMPL getxattr
392 230 UNIMPL lgetxattr
393 231 UNIMPL fgetxattr
394 232 UNIMPL listxattr
395 233 UNIMPL llistxattr
396 234 UNIMPL flistxattr
397 235 UNIMPL removexattr
398 236 UNIMPL lremovexattr
399 237 UNIMPL fremovexattr
400 238 UNIMPL tkill
401 239 UNIMPL sendfile64
402 240 UNIMPL futex
403 241 UNIMPL sched_setaffinity
404 242 UNIMPL sched_getaffinity
405 243 UNIMPL set_thread_area
406 244 UNIMPL get_thread_area
407 245 UNIMPL io_setup
408 246 UNIMPL io_destroy
409 247 UNIMPL io_getevents
410 248 UNIMPL io_submit
411 249 UNIMPL io_cancel
412 250 UNIMPL fadvise64
413 251 UNIMPL /* unused */
414 252 STD { int linux32_sys_exit_group(int error_code); }
415 253 UNIMPL lookup_dcookie
416 254 UNIMPL epoll_create
417 255 UNIMPL epoll_ctl
418 256 UNIMPL epoll_wait
419 257 UNIMPL remap_file_pages
420 258 UNIMPL set_tid_address
421 259 UNIMPL timer_create
422 260 UNIMPL timer_settime
423 261 UNIMPL timer_gettime
424 262 UNIMPL timer_getoverrun
425 263 UNIMPL timer_delete
426 264 STD { int linux32_sys_clock_settime(clockid_t which, \
427 linux32_timespecp_t tp); }
428 265 STD { int linux32_sys_clock_gettime(clockid_t which, \
429 linux32_timespecp_t tp); }
430 266 STD { int linux32_sys_clock_getres(clockid_t which, \
431 linux32_timespecp_t tp); }
432 267 UNIMPL clock_nanosleep
433 268 UNIMPL statfs64
434 269 UNIMPL fstatfs64
435 270 UNIMPL tgkill
436 271 UNIMPL utimes
437 272 UNIMPL fadvise64_64
438 273 UNIMPL vserver
439 274 UNIMPL mbind
440 275 UNIMPL get_mempolicy
441 276 UNIMPL set_mempolicy
442 277 UNIMPL mq_open
443 278 UNIMPL mq_unlink
444 279 UNIMPL mq_timedsend
445 280 UNIMPL mq_timedreceive
446 281 UNIMPL mq_notify
447 282 UNIMPL mq_getsetattr
448 283 UNIMPL kexec_load
449