Sun Jan 3 16:12:44 2021 UTC ()
Add preadv(2) and pwritev(2).


(thorpej)
diff -r1.71.2.2 -r1.71.2.3 src/sys/compat/linux32/arch/amd64/syscalls.master
diff -r1.30.2.2 -r1.30.2.3 src/sys/compat/linux32/common/linux32_misc.c

cvs diff -r1.71.2.2 -r1.71.2.3 src/sys/compat/linux32/arch/amd64/syscalls.master (switch to unified diff)

--- src/sys/compat/linux32/arch/amd64/syscalls.master 2020/12/17 03:05:32 1.71.2.2
+++ src/sys/compat/linux32/arch/amd64/syscalls.master 2021/01/03 16:12:43 1.71.2.3
@@ -1,587 +1,591 @@ @@ -1,587 +1,591 @@
1 $NetBSD: syscalls.master,v 1.71.2.2 2020/12/17 03:05:32 thorpej Exp $ 1 $NetBSD: syscalls.master,v 1.71.2.3 2021/01/03 16:12:43 thorpej Exp $
2 2
3; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file. 3; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
4; (See syscalls.conf to see what it is processed into.) 4; (See syscalls.conf to see what it is processed into.)
5; 5;
6; Fields: number type [type-dependent ...] 6; Fields: number type [type-dependent ...]
7; number system call number, must be in order 7; number system call number, must be in order
8; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 8; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
9; the compatibility options defined in syscalls.conf. 9; the compatibility options defined in syscalls.conf.
10; 10;
11; types: 11; types:
12; STD always included 12; STD always included
13; OBSOL obsolete, not included in system 13; OBSOL obsolete, not included in system
14; UNIMPL unimplemented, not included in system 14; UNIMPL unimplemented, not included in system
15; NODEF included, but don't define the syscall number 15; NODEF included, but don't define the syscall number
16; 16;
17; INDIR included, but don't define the syscall args structure 17; INDIR included, but don't define the syscall args structure
18; and allow it to be "really" varargs. 18; and allow it to be "really" varargs.
19; 19;
20; The compat options are defined in the syscalls.conf file, and the 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 21; compat option name is prefixed to the syscall name. Other than
22; that, they're like NODEF (for 'compat' options), or STD (for 22; that, they're like NODEF (for 'compat' options), or STD (for
23; 'libcompat' options). 23; 'libcompat' options).
24; 24;
25; The type-dependent arguments are as follows: 25; The type-dependent arguments are as follows:
26; For STD, NODEF, NOARGS, and compat syscalls: 26; For STD, NODEF, NOARGS, and compat syscalls:
27; { pseudo-proto } [alias] 27; { pseudo-proto } [alias]
28; For other syscalls: 28; For other syscalls:
29; [comment] 29; [comment]
30; 30;
31; #ifdef's, etc. may be included, and are copied to the output files. 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. 32; #include's are copied to the syscall names and switch definition files only.
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/poll.h> 35#include <sys/poll.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/signal.h> 37#include <sys/signal.h>
38#include <sys/mount.h> 38#include <sys/mount.h>
39#include <sys/syscallargs.h> 39#include <sys/syscallargs.h>
40 40
41#include <machine/netbsd32_machdep.h> 41#include <machine/netbsd32_machdep.h>
42 42
43#include <compat/netbsd32/netbsd32.h> 43#include <compat/netbsd32/netbsd32.h>
44#include <compat/netbsd32/netbsd32_syscallargs.h> 44#include <compat/netbsd32/netbsd32_syscallargs.h>
45 45
46#include <compat/linux/common/linux_types.h> 46#include <compat/linux/common/linux_types.h>
47 47
48#include <compat/linux32/common/linux32_types.h> 48#include <compat/linux32/common/linux32_types.h>
49#include <compat/linux32/common/linux32_signal.h> 49#include <compat/linux32/common/linux32_signal.h>
50#include <compat/linux32/arch/amd64/linux32_missing.h> 50#include <compat/linux32/arch/amd64/linux32_missing.h>
51#include <compat/linux32/linux32_syscallargs.h> 51#include <compat/linux32/linux32_syscallargs.h>
52 52
53#include <compat/linux/common/linux_mmap.h> 53#include <compat/linux/common/linux_mmap.h>
54#include <compat/linux/common/linux_signal.h> 54#include <compat/linux/common/linux_signal.h>
55#include <compat/linux/common/linux_siginfo.h> 55#include <compat/linux/common/linux_siginfo.h>
56#include <compat/linux/common/linux_machdep.h> 56#include <compat/linux/common/linux_machdep.h>
57#include <compat/linux/common/linux_ipc.h> 57#include <compat/linux/common/linux_ipc.h>
58#include <compat/linux/common/linux_sem.h> 58#include <compat/linux/common/linux_sem.h>
59#include <compat/linux/linux_syscallargs.h> 59#include <compat/linux/linux_syscallargs.h>
60 60
61%% 61%%
62 62
630 NOARGS { int|linux_sys||nosys(void); } syscall 630 NOARGS { int|linux_sys||nosys(void); } syscall
641 STD { int|linux32_sys||exit(int rval); } 641 STD { int|linux32_sys||exit(int rval); }
652 NOARGS { int|sys||fork(void); } 652 NOARGS { int|sys||fork(void); }
663 NOARGS { netbsd32_ssize_t|netbsd32||read(int fd, \ 663 NOARGS { netbsd32_ssize_t|netbsd32||read(int fd, \
67 netbsd32_voidp buf, netbsd32_size_t nbyte); } 67 netbsd32_voidp buf, netbsd32_size_t nbyte); }
684 NOARGS { netbsd32_ssize_t|netbsd32||write(int fd, \ 684 NOARGS { netbsd32_ssize_t|netbsd32||write(int fd, \
69 netbsd32_voidp buf, netbsd32_size_t nbyte); } 69 netbsd32_voidp buf, netbsd32_size_t nbyte); }
705 STD { int|linux32_sys||open(netbsd32_charp path, int flags, \ 705 STD { int|linux32_sys||open(netbsd32_charp path, int flags, \
71 linux_umode_t mode); } 71 linux_umode_t mode); }
726 NOARGS { int|netbsd32||close(int fd); } 726 NOARGS { int|netbsd32||close(int fd); }
737 STD { int|linux32_sys||waitpid(int pid, netbsd32_intp status, \ 737 STD { int|linux32_sys||waitpid(int pid, netbsd32_intp status, \
74 int options);} 74 int options);}
758 STD { int|linux32_sys||creat(netbsd32_charp path, linux_umode_t mode); } 758 STD { int|linux32_sys||creat(netbsd32_charp path, linux_umode_t mode); }
769 NOARGS { int|netbsd32||link(netbsd32_charp path, \ 769 NOARGS { int|netbsd32||link(netbsd32_charp path, \
77 netbsd32_charp link); } 77 netbsd32_charp link); }
7810 STD { int|linux32_sys||unlink(netbsd32_charp path); } 7810 STD { int|linux32_sys||unlink(netbsd32_charp path); }
7911 NOARGS { int|netbsd32||execve(netbsd32_charp path, \ 7911 NOARGS { int|netbsd32||execve(netbsd32_charp path, \
80 netbsd32_charpp argp, netbsd32_charpp envp); } 80 netbsd32_charpp argp, netbsd32_charpp envp); }
8112 NOARGS { int|netbsd32||chdir(netbsd32_charp path); } 8112 NOARGS { int|netbsd32||chdir(netbsd32_charp path); }
8213 STD { int|linux32_sys||time(linux32_timep_t t); } 8213 STD { int|linux32_sys||time(linux32_timep_t t); }
8314 STD { int|linux32_sys||mknod(netbsd32_charp path, \ 8314 STD { int|linux32_sys||mknod(netbsd32_charp path, \
84 linux_umode_t mode, unsigned dev); } 84 linux_umode_t mode, unsigned dev); }
8515 NOARGS { int|netbsd32||chmod(netbsd32_charp path, linux_umode_t mode); } 8515 NOARGS { int|netbsd32||chmod(netbsd32_charp path, linux_umode_t mode); }
8616 STD { int|linux32_sys||lchown16(netbsd32_charp path, \ 8616 STD { int|linux32_sys||lchown16(netbsd32_charp path, \
87 linux32_uid16_t uid, linux32_gid16_t gid); } 87 linux32_uid16_t uid, linux32_gid16_t gid); }
8817 STD { int|linux32_sys||break(netbsd32_charp nsize); } 8817 STD { int|linux32_sys||break(netbsd32_charp nsize); }
8918 OBSOL ostat 8918 OBSOL ostat
9019 NOARGS { netbsd32_long|compat_43_netbsd32||olseek(int fd, \ 9019 NOARGS { netbsd32_long|compat_43_netbsd32||olseek(int fd, \
91 netbsd32_long offset, int whence); } 91 netbsd32_long offset, int whence); }
9220 NOARGS { pid_t|sys||getpid(void); } 9220 NOARGS { pid_t|sys||getpid(void); }
9321 UNIMPL mount 9321 UNIMPL mount
9422 UNIMPL umount 9422 UNIMPL umount
9523 NOARGS linux_setuid16 { int|netbsd32||setuid(uid_t uid); } 9523 NOARGS linux_setuid16 { int|netbsd32||setuid(uid_t uid); }
9624 NOARGS linux_getuid16 { uid_t|sys||getuid(void); } 9624 NOARGS linux_getuid16 { uid_t|sys||getuid(void); }
9725 STD { int|linux32_sys||stime(linux32_timep_t t); } 9725 STD { int|linux32_sys||stime(linux32_timep_t t); }
9826 STD { int|linux32_sys||ptrace(int request, int pid, \ 9826 STD { int|linux32_sys||ptrace(int request, int pid, \
99 int addr, int data); } 99 int addr, int data); }
10027 STD { int|linux32_sys||alarm(unsigned int secs); } 10027 STD { int|linux32_sys||alarm(unsigned int secs); }
10128 OBSOL ofstat 10128 OBSOL ofstat
10229 NOARGS { int|linux_sys||pause(void); } 10229 NOARGS { int|linux_sys||pause(void); }
10330 STD { int|linux32_sys||utime(netbsd32_charp path, \ 10330 STD { int|linux32_sys||utime(netbsd32_charp path, \
104 linux32_utimbufp_t times); } 104 linux32_utimbufp_t times); }
10531 OBSOL stty 10531 OBSOL stty
10632 OBSOL gtty 10632 OBSOL gtty
10733 NOARGS { int|netbsd32||access(netbsd32_charp path, \ 10733 NOARGS { int|netbsd32||access(netbsd32_charp path, \
108 int flags); } 108 int flags); }
10934 STD { int|linux32_sys||nice(int incr); } 10934 STD { int|linux32_sys||nice(int incr); }
11035 OBSOL ftime 11035 OBSOL ftime
11136 NOARGS { int|sys||sync(void); } 11136 NOARGS { int|sys||sync(void); }
11237 STD { int|linux32_sys||kill(int pid, int signum); } 11237 STD { int|linux32_sys||kill(int pid, int signum); }
11338 NOARGS { int|netbsd32||__posix_rename(netbsd32_charp from, \ 11338 NOARGS { int|netbsd32||__posix_rename(netbsd32_charp from, \
114 netbsd32_charp to); } 114 netbsd32_charp to); }
11539 NOARGS { int|netbsd32||mkdir(netbsd32_charp path, linux_umode_t mode); } 11539 NOARGS { int|netbsd32||mkdir(netbsd32_charp path, linux_umode_t mode); }
11640 NOARGS { int|netbsd32||rmdir(netbsd32_charp path); } 11640 NOARGS { int|netbsd32||rmdir(netbsd32_charp path); }
11741 NOARGS { int|netbsd32||dup(int fd); } 11741 NOARGS { int|netbsd32||dup(int fd); }
11842 STD { int|linux32_sys||pipe(netbsd32_intp fd); } 11842 STD { int|linux32_sys||pipe(netbsd32_intp fd); }
11943 STD { int|linux32_sys||times(linux32_tmsp_t tms); } 11943 STD { int|linux32_sys||times(linux32_tmsp_t tms); }
12044 OBSOL prof 12044 OBSOL prof
12145 STD { int|linux32_sys||brk(netbsd32_charp nsize); } 12145 STD { int|linux32_sys||brk(netbsd32_charp nsize); }
12246 NOARGS linux_setgid16 { int|netbsd32||setgid(gid_t gid); } 12246 NOARGS linux_setgid16 { int|netbsd32||setgid(gid_t gid); }
12347 NOARGS linux_getgid16 { gid_t|sys||getgid(void); } 12347 NOARGS linux_getgid16 { gid_t|sys||getgid(void); }
12448 STD { int|linux32_sys||signal(int signum, \ 12448 STD { int|linux32_sys||signal(int signum, \
125 linux32_handlerp_t handler); } 125 linux32_handlerp_t handler); }
12649 NOARGS linux_geteuid16 { uid_t|sys||geteuid(void); } 12649 NOARGS linux_geteuid16 { uid_t|sys||geteuid(void); }
12750 NOARGS linux_getegid16 { gid_t|sys||getegid(void); } 12750 NOARGS linux_getegid16 { gid_t|sys||getegid(void); }
12851 NOARGS { int|netbsd32||acct(netbsd32_charp path); } 12851 NOARGS { int|netbsd32||acct(netbsd32_charp path); }
12952 OBSOL phys 12952 OBSOL phys
13053 OBSOL lock 13053 OBSOL lock
13154 STD { int|linux32_sys||ioctl(int fd, netbsd32_u_long com, \ 13154 STD { int|linux32_sys||ioctl(int fd, netbsd32_u_long com, \
132 netbsd32_charp data); } 132 netbsd32_charp data); }
13355 STD { int|linux32_sys||fcntl(int fd, \ 13355 STD { int|linux32_sys||fcntl(int fd, \
134 int cmd, netbsd32_voidp arg); } 134 int cmd, netbsd32_voidp arg); }
13556 OBSOL mpx 13556 OBSOL mpx
13657 NOARGS { int|netbsd32||setpgid(int pid, int pgid); } 13657 NOARGS { int|netbsd32||setpgid(int pid, int pgid); }
13758 OBSOL ulimit 13758 OBSOL ulimit
13859 STD { int|linux32_sys||oldolduname( \ 13859 STD { int|linux32_sys||oldolduname( \
139 linux32_oldold_utsnamep_t up); } 139 linux32_oldold_utsnamep_t up); }
14060 NOARGS { int|netbsd32||umask(int newmask); } 14060 NOARGS { int|netbsd32||umask(int newmask); }
14161 NOARGS { int|netbsd32||chroot(netbsd32_charp path); } 14161 NOARGS { int|netbsd32||chroot(netbsd32_charp path); }
14262 UNIMPL ustat 14262 UNIMPL ustat
14363 NOARGS { int|netbsd32||dup2(int from, int to); } 14363 NOARGS { int|netbsd32||dup2(int from, int to); }
14464 NOARGS { pid_t|sys||getppid(void); } 14464 NOARGS { pid_t|sys||getppid(void); }
14565 NOARGS { int|sys||getpgrp(void); } 14565 NOARGS { int|sys||getpgrp(void); }
14666 NOARGS { int|sys||setsid(void); } 14666 NOARGS { int|sys||setsid(void); }
14767 UNIMPL sigaction 14767 UNIMPL sigaction
14868 STD { int|linux32_sys||siggetmask(void); } 14868 STD { int|linux32_sys||siggetmask(void); }
14969 STD { int|linux32_sys||sigsetmask(linux32_old_sigset_t mask); } 14969 STD { int|linux32_sys||sigsetmask(linux32_old_sigset_t mask); }
15070 STD { int|linux32_sys||setreuid16(linux32_uid16_t ruid, \ 15070 STD { int|linux32_sys||setreuid16(linux32_uid16_t ruid, \
151 linux32_uid16_t euid); } 151 linux32_uid16_t euid); }
15271 STD { int|linux32_sys||setregid16(linux32_gid16_t rgid, \ 15271 STD { int|linux32_sys||setregid16(linux32_gid16_t rgid, \
153 linux32_gid16_t egid); } 153 linux32_gid16_t egid); }
15472 UNIMPL sigsuspend 15472 UNIMPL sigsuspend
15573 UNIMPL sigpending 15573 UNIMPL sigpending
15674 NOARGS { int|compat_43_netbsd32||osethostname(netbsd32_charp hostname, \ 15674 NOARGS { int|compat_43_netbsd32||osethostname(netbsd32_charp hostname, \
157 u_int len); } 157 u_int len); }
15875 STD { int|linux32_sys||setrlimit(u_int which, \ 15875 STD { int|linux32_sys||setrlimit(u_int which, \
159 netbsd32_orlimitp_t rlp); } 159 netbsd32_orlimitp_t rlp); }
16076 STD { int|linux32_sys||getrlimit(u_int which, \ 16076 STD { int|linux32_sys||getrlimit(u_int which, \
161 netbsd32_orlimitp_t rlp); } 161 netbsd32_orlimitp_t rlp); }
16277 NOARGS { int|compat_50_netbsd32||getrusage(int who, \ 16277 NOARGS { int|compat_50_netbsd32||getrusage(int who, \
163 netbsd32_rusage50p_t rusage); } 163 netbsd32_rusage50p_t rusage); }
16478 STD { int|linux32_sys||gettimeofday(netbsd32_timeval50p_t tp, \ 16478 STD { int|linux32_sys||gettimeofday(netbsd32_timeval50p_t tp, \
165 netbsd32_timezonep_t tzp); } 165 netbsd32_timezonep_t tzp); }
16679 STD { int|linux32_sys||settimeofday(netbsd32_timeval50p_t tp, \ 16679 STD { int|linux32_sys||settimeofday(netbsd32_timeval50p_t tp, \
167 netbsd32_timezonep_t tzp); } 167 netbsd32_timezonep_t tzp); }
16880 STD { int|linux32_sys||getgroups16(int gidsetsize, \ 16880 STD { int|linux32_sys||getgroups16(int gidsetsize, \
169 linux32_gid16p_t gidset); } 169 linux32_gid16p_t gidset); }
17081 STD { int|linux32_sys||setgroups16(int gidsetsize, \ 17081 STD { int|linux32_sys||setgroups16(int gidsetsize, \
171 linux32_gid16p_t gidset); } 171 linux32_gid16p_t gidset); }
17282 STD { int|linux32_sys||oldselect(linux32_oldselectp_t lsp); } 17282 STD { int|linux32_sys||oldselect(linux32_oldselectp_t lsp); }
17383 NOARGS { int|netbsd32||symlink(netbsd32_charp path, \ 17383 NOARGS { int|netbsd32||symlink(netbsd32_charp path, \
174 netbsd32_charp link); } 174 netbsd32_charp link); }
17584 NOARGS { int|compat_43_netbsd32||lstat43(netbsd32_charp \ 17584 NOARGS { int|compat_43_netbsd32||lstat43(netbsd32_charp \
176 path, netbsd32_stat43p_t ub); } 176 path, netbsd32_stat43p_t ub); }
17785 NOARGS { int|netbsd32||readlink(netbsd32_charp path, \ 17785 NOARGS { int|netbsd32||readlink(netbsd32_charp path, \
178 netbsd32_charp buf, netbsd32_size_t count); } 178 netbsd32_charp buf, netbsd32_size_t count); }
17986 UNIMPL uselib 17986 UNIMPL uselib
18087 STD { int|linux32_sys||swapon(netbsd32_charp name); } 18087 STD { int|linux32_sys||swapon(netbsd32_charp name); }
18188 STD { int|linux32_sys||reboot(int magic1, int magic2, int cmd, \ 18188 STD { int|linux32_sys||reboot(int magic1, int magic2, int cmd, \
182 netbsd32_voidp arg); } 182 netbsd32_voidp arg); }
18389 STD { int|linux32_sys||readdir(int fd, netbsd32_voidp dent, \ 18389 STD { int|linux32_sys||readdir(int fd, netbsd32_voidp dent, \
184 unsigned int count); } 184 unsigned int count); }
18590 STD { int|linux32_sys||old_mmap(linux32_oldmmapp lmp); } 18590 STD { int|linux32_sys||old_mmap(linux32_oldmmapp lmp); }
18691 NOARGS { int|netbsd32||munmap(netbsd32_voidp addr, \ 18691 NOARGS { int|netbsd32||munmap(netbsd32_voidp addr, \
187 netbsd32_size_t len); } 187 netbsd32_size_t len); }
18892 NOARGS { int|compat_43_netbsd32||otruncate(netbsd32_charp path, \ 18892 NOARGS { int|compat_43_netbsd32||otruncate(netbsd32_charp path, \
189 netbsd32_long length); } 189 netbsd32_long length); }
19093 NOARGS { int|compat_43_netbsd32||oftruncate(int fd, \ 19093 NOARGS { int|compat_43_netbsd32||oftruncate(int fd, \
191 netbsd32_long length); } 191 netbsd32_long length); }
19294 NOARGS { int|netbsd32||fchmod(int fd, linux_umode_t mode); } 19294 NOARGS { int|netbsd32||fchmod(int fd, linux_umode_t mode); }
19395 STD { int|linux32_sys||fchown16(int fd, linux32_uid16_t uid, \ 19395 STD { int|linux32_sys||fchown16(int fd, linux32_uid16_t uid, \
194 linux32_gid16_t gid); } 194 linux32_gid16_t gid); }
19596 STD { int|linux32_sys||getpriority(int which, int who); } 19596 STD { int|linux32_sys||getpriority(int which, int who); }
19697 NOARGS { int|netbsd32||setpriority(int which, int who, int prio); } 19697 NOARGS { int|netbsd32||setpriority(int which, int who, int prio); }
19798 NOARGS { int|netbsd32||profil(netbsd32_voidp samples, \ 19798 NOARGS { int|netbsd32||profil(netbsd32_voidp samples, \
198 netbsd32_size_t size, netbsd32_u_long offset, \ 198 netbsd32_size_t size, netbsd32_u_long offset, \
199 u_int scale); } 199 u_int scale); }
20099 STD { int|linux32_sys||statfs(netbsd32_charp path, \ 20099 STD { int|linux32_sys||statfs(netbsd32_charp path, \
201 linux32_statfsp sp); } 201 linux32_statfsp sp); }
202100 STD { int|linux32_sys||fstatfs(int fd, linux32_statfsp sp); } 202100 STD { int|linux32_sys||fstatfs(int fd, linux32_statfsp sp); }
203101 NOARGS { int|linux_sys||ioperm(unsigned int lo, \ 203101 NOARGS { int|linux_sys||ioperm(unsigned int lo, \
204 unsigned int hi, int val); } 204 unsigned int hi, int val); }
205102 STD { int|linux32_sys||socketcall(int what, netbsd32_voidp args); } 205102 STD { int|linux32_sys||socketcall(int what, netbsd32_voidp args); }
206103 UNIMPL syslog 206103 UNIMPL syslog
207104 NOARGS { int|compat_50_netbsd32||setitimer(int which, \ 207104 NOARGS { int|compat_50_netbsd32||setitimer(int which, \
208 netbsd32_itimerval50p_t itv, netbsd32_itimerval50p_t oitv); } 208 netbsd32_itimerval50p_t itv, netbsd32_itimerval50p_t oitv); }
209105 NOARGS { int|compat_50_netbsd32||getitimer(int which, \ 209105 NOARGS { int|compat_50_netbsd32||getitimer(int which, \
210 netbsd32_itimerval50p_t itv); } 210 netbsd32_itimerval50p_t itv); }
211106 STD { int|linux32_sys||stat(netbsd32_charp path, \ 211106 STD { int|linux32_sys||stat(netbsd32_charp path, \
212 linux32_statp sp); } 212 linux32_statp sp); }
213107 STD { int|linux32_sys||lstat(netbsd32_charp path, \ 213107 STD { int|linux32_sys||lstat(netbsd32_charp path, \
214 linux32_statp sp); } 214 linux32_statp sp); }
215108 STD { int|linux32_sys||fstat(int fd, \ 215108 STD { int|linux32_sys||fstat(int fd, \
216 linux32_statp sp); } 216 linux32_statp sp); }
217109 STD { int|linux32_sys||olduname(linux32_oldutsnamep_t up); } 217109 STD { int|linux32_sys||olduname(linux32_oldutsnamep_t up); }
218110 NOARGS { int|linux_sys||iopl(int level); } 218110 NOARGS { int|linux_sys||iopl(int level); }
219111 UNIMPL vhangup 219111 UNIMPL vhangup
220112 UNIMPL idle 220112 UNIMPL idle
221113 UNIMPL vm86old 221113 UNIMPL vm86old
222114 STD { int|linux32_sys||wait4(int pid, netbsd32_intp status, \ 222114 STD { int|linux32_sys||wait4(int pid, netbsd32_intp status, \
223 int options, netbsd32_rusage50p_t rusage); } 223 int options, netbsd32_rusage50p_t rusage); }
224115 STD { int|linux32_sys||swapoff(netbsd32_charp path); } 224115 STD { int|linux32_sys||swapoff(netbsd32_charp path); }
225116 STD { int|linux32_sys||sysinfo(linux32_sysinfop_t arg); } 225116 STD { int|linux32_sys||sysinfo(linux32_sysinfop_t arg); }
226117 STD { int|linux32_sys||ipc(int what, int a1, int a2, int a3, \ 226117 STD { int|linux32_sys||ipc(int what, int a1, int a2, int a3, \
227 netbsd32_voidp ptr); } 227 netbsd32_voidp ptr); }
228118 NOARGS { int|netbsd32||fsync(int fd); } 228118 NOARGS { int|netbsd32||fsync(int fd); }
229119 STD { int|linux32_sys||sigreturn(linux32_sigcontextp_t scp); } 229119 STD { int|linux32_sys||sigreturn(linux32_sigcontextp_t scp); }
230120 STD { int|linux32_sys||clone(int flags, netbsd32_voidp stack, \ 230120 STD { int|linux32_sys||clone(int flags, netbsd32_voidp stack, \
231 netbsd32_voidp parent_tidptr, netbsd32_voidp tls, \ 231 netbsd32_voidp parent_tidptr, netbsd32_voidp tls, \
232 netbsd32_voidp child_tidptr); } 232 netbsd32_voidp child_tidptr); }
233121 STD { int|linux32_sys||setdomainname(netbsd32_charp domainname, \ 233121 STD { int|linux32_sys||setdomainname(netbsd32_charp domainname, \
234 int len); } 234 int len); }
235122 STD { int|linux32_sys||uname(linux32_utsnamep up); } 235122 STD { int|linux32_sys||uname(linux32_utsnamep up); }
236123 STD { int|linux32_sys||modify_ldt(int func, netbsd32_charp ptr, \ 236123 STD { int|linux32_sys||modify_ldt(int func, netbsd32_charp ptr, \
237 netbsd32_size_t bytecount); } 237 netbsd32_size_t bytecount); }
238124 UNIMPL adjtimex 238124 UNIMPL adjtimex
239125 STD { int|linux32_sys||mprotect(netbsd32_voidp start, \ 239125 STD { int|linux32_sys||mprotect(netbsd32_voidp start, \
240 netbsd32_size_t len, int prot); }  240 netbsd32_size_t len, int prot); }
241126 UNIMPL sigprocmask 241126 UNIMPL sigprocmask
242127 UNIMPL create_module 242127 UNIMPL create_module
243128 UNIMPL init_module 243128 UNIMPL init_module
244129 UNIMPL delete_module 244129 UNIMPL delete_module
245130 UNIMPL get_kernel_syms 245130 UNIMPL get_kernel_syms
246131 UNIMPL quotactl 246131 UNIMPL quotactl
247132 NOARGS { int|netbsd32||getpgid(pid_t pid); } 247132 NOARGS { int|netbsd32||getpgid(pid_t pid); }
248133 NOARGS { int|netbsd32||fchdir(int fd); } 248133 NOARGS { int|netbsd32||fchdir(int fd); }
249134 UNIMPL bdflush 249134 UNIMPL bdflush
250135 UNIMPL sysfs 250135 UNIMPL sysfs
251136 STD { int|linux32_sys||personality(netbsd32_u_long per); } 251136 STD { int|linux32_sys||personality(netbsd32_u_long per); }
252137 UNIMPL afs_syscall 252137 UNIMPL afs_syscall
253138 NOARGS setfsuid16 { int|linux32_sys||setfsuid(uid_t uid); } 253138 NOARGS setfsuid16 { int|linux32_sys||setfsuid(uid_t uid); }
254139 NOARGS setfsgid16 { int|linux32_sys||setfsgid(gid_t gid); } 254139 NOARGS setfsgid16 { int|linux32_sys||setfsgid(gid_t gid); }
255140 STD { int|linux32_sys||llseek(int fd, u_int32_t ohigh, \ 255140 STD { int|linux32_sys||llseek(int fd, u_int32_t ohigh, \
256 u_int32_t olow, netbsd32_voidp res, int whence); } 256 u_int32_t olow, netbsd32_voidp res, int whence); }
257141 STD { int|linux32_sys||getdents(int fd, \ 257141 STD { int|linux32_sys||getdents(int fd, \
258 linux32_direntp_t dent, unsigned int count); } 258 linux32_direntp_t dent, unsigned int count); }
259142 STD { int|linux32_sys||select(int nfds, \ 259142 STD { int|linux32_sys||select(int nfds, \
260 netbsd32_fd_setp_t readfds, \ 260 netbsd32_fd_setp_t readfds, \
261 netbsd32_fd_setp_t writefds, \ 261 netbsd32_fd_setp_t writefds, \
262 netbsd32_fd_setp_t exceptfds, \ 262 netbsd32_fd_setp_t exceptfds, \
263 netbsd32_timeval50p_t timeout); } 263 netbsd32_timeval50p_t timeout); }
264143 NOARGS { int|netbsd32||flock(int fd, int how); }  264143 NOARGS { int|netbsd32||flock(int fd, int how); }
265144 NOARGS { int|netbsd32|13|msync(netbsd32_voidp addr, \ 265144 NOARGS { int|netbsd32|13|msync(netbsd32_voidp addr, \
266 netbsd32_size_t len, int flags); } 266 netbsd32_size_t len, int flags); }
267145 NOARGS { int|netbsd32||readv(int fd, \ 267145 NOARGS { int|netbsd32||readv(int fd, \
268 netbsd32_iovecp_t iovp, int iovcnt); } 268 netbsd32_iovecp_t iovp, int iovcnt); }
269146 NOARGS { netbsd32_ssize_t|netbsd32||writev(int fd, \ 269146 NOARGS { netbsd32_ssize_t|netbsd32||writev(int fd, \
270 netbsd32_iovecp_t iovp, int iovcnt); } 270 netbsd32_iovecp_t iovp, int iovcnt); }
271147 NOARGS { pid_t|netbsd32||getsid(pid_t pid); } 271147 NOARGS { pid_t|netbsd32||getsid(pid_t pid); }
272148 STD { int|linux32_sys||fdatasync(int fd); } 272148 STD { int|linux32_sys||fdatasync(int fd); }
273149 STD { int|linux32_sys||__sysctl(linux32___sysctlp_t lsp); } 273149 STD { int|linux32_sys||__sysctl(linux32___sysctlp_t lsp); }
274150 NOARGS { int|netbsd32||mlock(netbsd32_voidp addr, \ 274150 NOARGS { int|netbsd32||mlock(netbsd32_voidp addr, \
275 netbsd32_size_t len); } 275 netbsd32_size_t len); }
276151 NOARGS { int|netbsd32||munlock(netbsd32_voidp addr, \ 276151 NOARGS { int|netbsd32||munlock(netbsd32_voidp addr, \
277 netbsd32_size_t len); } 277 netbsd32_size_t len); }
278152 NOARGS { int|netbsd32||mlockall(int flags); } 278152 NOARGS { int|netbsd32||mlockall(int flags); }
279153 NOARGS { int|sys||munlockall(void); } 279153 NOARGS { int|sys||munlockall(void); }
280154 STD { int|linux32_sys||sched_setparam(pid_t pid, \ 280154 STD { int|linux32_sys||sched_setparam(pid_t pid, \
281 const linux32_sched_paramp_t sp); } 281 const linux32_sched_paramp_t sp); }
282155 STD { int|linux32_sys||sched_getparam(pid_t pid, \ 282155 STD { int|linux32_sys||sched_getparam(pid_t pid, \
283 linux32_sched_paramp_t sp); } 283 linux32_sched_paramp_t sp); }
284156 STD { int|linux32_sys||sched_setscheduler(pid_t pid, \ 284156 STD { int|linux32_sys||sched_setscheduler(pid_t pid, \
285 int policy, linux32_sched_paramp_t sp); } 285 int policy, linux32_sched_paramp_t sp); }
286157 STD { int|linux32_sys||sched_getscheduler(pid_t pid); } 286157 STD { int|linux32_sys||sched_getscheduler(pid_t pid); }
287158 NOARGS { int|linux_sys||sched_yield(void); } 287158 NOARGS { int|linux_sys||sched_yield(void); }
288159 STD { int|linux32_sys||sched_get_priority_max(int policy); } 288159 STD { int|linux32_sys||sched_get_priority_max(int policy); }
289160 STD { int|linux32_sys||sched_get_priority_min(int policy); } 289160 STD { int|linux32_sys||sched_get_priority_min(int policy); }
290161 UNIMPL sched_rr_get_interval 290161 UNIMPL sched_rr_get_interval
291162 STD { int|linux32_sys||nanosleep(linux32_timespecp_t rqtp, \ 291162 STD { int|linux32_sys||nanosleep(linux32_timespecp_t rqtp, \
292 linux32_timespecp_t rmtp); } 292 linux32_timespecp_t rmtp); }
293163 STD { int|linux32_sys||mremap(netbsd32_voidp old_address, \ 293163 STD { int|linux32_sys||mremap(netbsd32_voidp old_address, \
294 netbsd32_size_t old_size, netbsd32_size_t new_size, \ 294 netbsd32_size_t old_size, netbsd32_size_t new_size, \
295 netbsd32_u_long flags); } 295 netbsd32_u_long flags); }
296164 STD { int|linux32_sys||setresuid16(linux32_uid16_t ruid, \ 296164 STD { int|linux32_sys||setresuid16(linux32_uid16_t ruid, \
297 linux32_uid16_t euid, linux32_uid16_t suid); } 297 linux32_uid16_t euid, linux32_uid16_t suid); }
298165 STD { int|linux32_sys||getresuid16(linux32_uid16p_t ruid, \ 298165 STD { int|linux32_sys||getresuid16(linux32_uid16p_t ruid, \
299 linux32_uid16p_t euid, linux32_uid16p_t suid); } 299 linux32_uid16p_t euid, linux32_uid16p_t suid); }
300166 UNIMPL vm86 300166 UNIMPL vm86
301167 UNIMPL query_module 301167 UNIMPL query_module
302168 NOARGS { int|netbsd32||poll(netbsd32_pollfdp_t fds, u_int nfds, \ 302168 NOARGS { int|netbsd32||poll(netbsd32_pollfdp_t fds, u_int nfds, \
303 int timeout); } 303 int timeout); }
304169 UNIMPL nfsservctl 304169 UNIMPL nfsservctl
305170 STD { int|linux32_sys||setresgid16(linux32_gid16_t rgid, \ 305170 STD { int|linux32_sys||setresgid16(linux32_gid16_t rgid, \
306 linux32_gid16_t egid, linux32_gid16_t sgid); } 306 linux32_gid16_t egid, linux32_gid16_t sgid); }
307171 STD { int|linux32_sys||getresgid16(linux32_gid16p_t rgid, \ 307171 STD { int|linux32_sys||getresgid16(linux32_gid16p_t rgid, \
308 linux32_gid16p_t egid, linux32_gid16p_t sgid); } 308 linux32_gid16p_t egid, linux32_gid16p_t sgid); }
309172 UNIMPL prctl 309172 UNIMPL prctl
310173 STD { int|linux32_sys||rt_sigreturn(linux32_ucontextp_t ucp); } 310173 STD { int|linux32_sys||rt_sigreturn(linux32_ucontextp_t ucp); }
311174 STD { int|linux32_sys||rt_sigaction(int signum, \ 311174 STD { int|linux32_sys||rt_sigaction(int signum, \
312 linux32_sigactionp_t nsa, \ 312 linux32_sigactionp_t nsa, \
313 linux32_sigactionp_t osa, \ 313 linux32_sigactionp_t osa, \
314 netbsd32_size_t sigsetsize); } 314 netbsd32_size_t sigsetsize); }
315175 STD { int|linux32_sys||rt_sigprocmask(int how, \ 315175 STD { int|linux32_sys||rt_sigprocmask(int how, \
316 linux32_sigsetp_t set, \ 316 linux32_sigsetp_t set, \
317 linux32_sigsetp_t oset, \ 317 linux32_sigsetp_t oset, \
318 netbsd32_size_t sigsetsize); } 318 netbsd32_size_t sigsetsize); }
319176 STD { int|linux32_sys||rt_sigpending(linux32_sigsetp_t set, \ 319176 STD { int|linux32_sys||rt_sigpending(linux32_sigsetp_t set, \
320 netbsd32_size_t sigsetsize); } 320 netbsd32_size_t sigsetsize); }
321177 STD { int|linux32_sys||rt_sigtimedwait( \ 321177 STD { int|linux32_sys||rt_sigtimedwait( \
322 const linux32_sigsetp_t set, \ 322 const linux32_sigsetp_t set, \
323 linux32_siginfop_t info, \ 323 linux32_siginfop_t info, \
324 const linux32_timespecp_t timeout); } 324 const linux32_timespecp_t timeout); }
325178 STD { int|linux32_sys||rt_queueinfo(int pid, int sig, \ 325178 STD { int|linux32_sys||rt_queueinfo(int pid, int sig, \
326 linux32_siginfop_t uinfo); } 326 linux32_siginfop_t uinfo); }
327179 STD { int|linux32_sys||rt_sigsuspend(linux32_sigsetp_t unewset, \ 327179 STD { int|linux32_sys||rt_sigsuspend(linux32_sigsetp_t unewset, \
328 netbsd32_size_t sigsetsize); } 328 netbsd32_size_t sigsetsize); }
329180 STD { netbsd32_ssize_t|linux32_sys||pread(int fd, \ 329180 STD { netbsd32_ssize_t|linux32_sys||pread(int fd, \
330 netbsd32_voidp buf, netbsd32_size_t nbyte, \ 330 netbsd32_voidp buf, netbsd32_size_t nbyte, \
331 netbsd32_off_t offset); } 331 netbsd32_off_t offset); }
332181 STD { netbsd32_ssize_t|linux32_sys||pwrite(int fd, \ 332181 STD { netbsd32_ssize_t|linux32_sys||pwrite(int fd, \
333 netbsd32_voidp buf, netbsd32_size_t nbyte, \ 333 netbsd32_voidp buf, netbsd32_size_t nbyte, \
334 netbsd32_off_t offset); } 334 netbsd32_off_t offset); }
335182 STD { int|linux32_sys||chown16(netbsd32_charp path, \ 335182 STD { int|linux32_sys||chown16(netbsd32_charp path, \
336 linux32_uid16_t uid, linux32_gid16_t gid); } 336 linux32_uid16_t uid, linux32_gid16_t gid); }
337183 NOARGS { int|netbsd32||__getcwd(netbsd32_charp bufp, \ 337183 NOARGS { int|netbsd32||__getcwd(netbsd32_charp bufp, \
338 netbsd32_size_t length); }  338 netbsd32_size_t length); }
339184 UNIMPL capget 339184 UNIMPL capget
340185 UNIMPL capset 340185 UNIMPL capset
341186 UNIMPL sigaltstack 341186 UNIMPL sigaltstack
342187 UNIMPL sendfile 342187 UNIMPL sendfile
343188 UNIMPL getpmsg 343188 UNIMPL getpmsg
344189 UNIMPL putpmsg 344189 UNIMPL putpmsg
345190 NOARGS { int|sys|14|vfork(void); } 345190 NOARGS { int|sys|14|vfork(void); }
346191 STD { int|linux32_sys||ugetrlimit(int which, \ 346191 STD { int|linux32_sys||ugetrlimit(int which, \
347 netbsd32_orlimitp_t rlp); } 347 netbsd32_orlimitp_t rlp); }
348192 STD { linux32_off_t|linux32_sys||mmap2(netbsd32_u_long addr, \ 348192 STD { linux32_off_t|linux32_sys||mmap2(netbsd32_u_long addr, \
349 netbsd32_size_t len, int prot, int flags, int fd, \ 349 netbsd32_size_t len, int prot, int flags, int fd, \
350 linux32_off_t offset); } 350 linux32_off_t offset); }
351193 STD { int|linux32_sys||truncate64(netbsd32_charp path, \ 351193 STD { int|linux32_sys||truncate64(netbsd32_charp path, \
352 uint32_t lenlo, uint32_t lenhi); } 352 uint32_t lenlo, uint32_t lenhi); }
353194 STD { int|linux32_sys||ftruncate64(unsigned int fd, \ 353194 STD { int|linux32_sys||ftruncate64(unsigned int fd, \
354 uint32_t lenlo, uint32_t lenhi); } 354 uint32_t lenlo, uint32_t lenhi); }
355195 STD { int|linux32_sys||stat64(netbsd32_charp path, \ 355195 STD { int|linux32_sys||stat64(netbsd32_charp path, \
356 linux32_stat64p sp); } 356 linux32_stat64p sp); }
357196 STD { int|linux32_sys||lstat64(netbsd32_charp path, \ 357196 STD { int|linux32_sys||lstat64(netbsd32_charp path, \
358 linux32_stat64p sp); } 358 linux32_stat64p sp); }
359197 STD { int|linux32_sys||fstat64(int fd, \ 359197 STD { int|linux32_sys||fstat64(int fd, \
360 linux32_stat64p sp); } 360 linux32_stat64p sp); }
361198 NOARGS { int|netbsd32||__posix_lchown(netbsd32_charp path, \ 361198 NOARGS { int|netbsd32||__posix_lchown(netbsd32_charp path, \
362 uid_t uid, gid_t gid); } 362 uid_t uid, gid_t gid); }
363199 NOARGS { uid_t|sys||getuid(void); } 363199 NOARGS { uid_t|sys||getuid(void); }
364200 NOARGS { gid_t|sys||getgid(void); } 364200 NOARGS { gid_t|sys||getgid(void); }
365201 NOARGS { uid_t|sys||geteuid(void); } 365201 NOARGS { uid_t|sys||geteuid(void); }
366202 NOARGS { gid_t|sys||getegid(void); } 366202 NOARGS { gid_t|sys||getegid(void); }
367203 NOARGS { int|netbsd32||setreuid(uid_t ruid, uid_t euid); } 367203 NOARGS { int|netbsd32||setreuid(uid_t ruid, uid_t euid); }
368204 NOARGS { int|netbsd32||setregid(gid_t rgid, gid_t egid); } 368204 NOARGS { int|netbsd32||setregid(gid_t rgid, gid_t egid); }
369205 NOARGS { int|netbsd32||getgroups(int gidsetsize, \ 369205 NOARGS { int|netbsd32||getgroups(int gidsetsize, \
370 netbsd32_gid_tp gidset); } 370 netbsd32_gid_tp gidset); }
371206 NOARGS { int|netbsd32||setgroups(int gidsetsize, \ 371206 NOARGS { int|netbsd32||setgroups(int gidsetsize, \
372 netbsd32_gid_tp gidset); } 372 netbsd32_gid_tp gidset); }
373207 NOARGS { int|netbsd32||__posix_fchown(int fd, uid_t uid, gid_t gid); } 373207 NOARGS { int|netbsd32||__posix_fchown(int fd, uid_t uid, gid_t gid); }
374208 STD { int|linux32_sys||setresuid(uid_t ruid, uid_t euid, \ 374208 STD { int|linux32_sys||setresuid(uid_t ruid, uid_t euid, \
375 uid_t suid); } 375 uid_t suid); }
376209 STD { int|linux32_sys||getresuid(linux32_uidp_t ruid, \ 376209 STD { int|linux32_sys||getresuid(linux32_uidp_t ruid, \
377 linux32_uidp_t euid, linux32_uidp_t suid); } 377 linux32_uidp_t euid, linux32_uidp_t suid); }
378210 STD { int|linux32_sys||setresgid(gid_t rgid, gid_t egid, \ 378210 STD { int|linux32_sys||setresgid(gid_t rgid, gid_t egid, \
379 gid_t sgid); } 379 gid_t sgid); }
380211 STD { int|linux32_sys||getresgid(linux32_gidp_t rgid, \ 380211 STD { int|linux32_sys||getresgid(linux32_gidp_t rgid, \
381 linux32_gidp_t egid, linux32_gidp_t sgid); } 381 linux32_gidp_t egid, linux32_gidp_t sgid); }
382212 NOARGS { int|netbsd32||__posix_chown(netbsd32_charp path, \ 382212 NOARGS { int|netbsd32||__posix_chown(netbsd32_charp path, \
383 uid_t uid, gid_t gid); } 383 uid_t uid, gid_t gid); }
384213 NOARGS { int|netbsd32||setuid(uid_t uid); } 384213 NOARGS { int|netbsd32||setuid(uid_t uid); }
385214 NOARGS { int|netbsd32||setgid(gid_t gid); } 385214 NOARGS { int|netbsd32||setgid(gid_t gid); }
386215 STD { int|linux32_sys||setfsuid(uid_t uid); } 386215 STD { int|linux32_sys||setfsuid(uid_t uid); }
387216 STD { int|linux32_sys||setfsgid(gid_t gid); } 387216 STD { int|linux32_sys||setfsgid(gid_t gid); }
388217 UNIMPL pivot_root 388217 UNIMPL pivot_root
389218 NOARGS { int|netbsd32||mincore(netbsd32_voidp addr, \ 389218 NOARGS { int|netbsd32||mincore(netbsd32_voidp addr, \
390 netbsd32_size_t len, netbsd32_charp vec); } 390 netbsd32_size_t len, netbsd32_charp vec); }
391219 NOARGS { int|netbsd32||madvise(netbsd32_voidp addr, \ 391219 NOARGS { int|netbsd32||madvise(netbsd32_voidp addr, \
392 netbsd32_size_t len, int behav); } 392 netbsd32_size_t len, int behav); }
393220 STD { int|linux32_sys||getdents64(int fd, \ 393220 STD { int|linux32_sys||getdents64(int fd, \
394 linux32_dirent64p_t dent, unsigned int count); } 394 linux32_dirent64p_t dent, unsigned int count); }
395; fcntl64() - Exactly the same as fcntl() 395; fcntl64() - Exactly the same as fcntl()
396#define linux32_sys_fcntl64 linux32_sys_fcntl 396#define linux32_sys_fcntl64 linux32_sys_fcntl
397#define linux32_sys_fcntl64_args linux32_sys_fcntl_args 397#define linux32_sys_fcntl64_args linux32_sys_fcntl_args
398221 NOARGS { int|linux32_sys||fcntl64(int fd, \ 398221 NOARGS { int|linux32_sys||fcntl64(int fd, \
399 int cmd, netbsd32_voidp arg); } 399 int cmd, netbsd32_voidp arg); }
400222 UNIMPL /* unused */ 400222 UNIMPL /* unused */
401223 UNIMPL /* unused */ 401223 UNIMPL /* unused */
402224 NOARGS { pid_t|linux_sys||gettid(void); } 402224 NOARGS { pid_t|linux_sys||gettid(void); }
403225 UNIMPL readahead 403225 UNIMPL readahead
404226 NOARGS { int|netbsd32||setxattr(netbsd32_charp path, \ 404226 NOARGS { int|netbsd32||setxattr(netbsd32_charp path, \
405 netbsd32_charp name, netbsd32_voidp value, \ 405 netbsd32_charp name, netbsd32_voidp value, \
406 netbsd32_size_t size, int flags); } 406 netbsd32_size_t size, int flags); }
407227 NOARGS { int|netbsd32||lsetxattr(netbsd32_charp path, \ 407227 NOARGS { int|netbsd32||lsetxattr(netbsd32_charp path, \
408 netbsd32_charp name, netbsd32_voidp value, \ 408 netbsd32_charp name, netbsd32_voidp value, \
409 netbsd32_size_t size, int flags); } 409 netbsd32_size_t size, int flags); }
410228 NOARGS { int|netbsd32||fsetxattr(int fd, netbsd32_charp name, \ 410228 NOARGS { int|netbsd32||fsetxattr(int fd, netbsd32_charp name, \
411 netbsd32_voidp value, netbsd32_size_t size, int flags); } 411 netbsd32_voidp value, netbsd32_size_t size, int flags); }
412229 NOARGS { ssize_t|netbsd32||getxattr(netbsd32_charp path, \ 412229 NOARGS { ssize_t|netbsd32||getxattr(netbsd32_charp path, \
413 netbsd32_charp name, netbsd32_voidp value, \ 413 netbsd32_charp name, netbsd32_voidp value, \
414 netbsd32_size_t size); } 414 netbsd32_size_t size); }
415230 NOARGS { ssize_t|netbsd32||lgetxattr(netbsd32_charp path, \ 415230 NOARGS { ssize_t|netbsd32||lgetxattr(netbsd32_charp path, \
416 netbsd32_charp name, netbsd32_voidp value, \ 416 netbsd32_charp name, netbsd32_voidp value, \
417 netbsd32_size_t size); } 417 netbsd32_size_t size); }
418231 NOARGS { ssize_t|netbsd32||fgetxattr(int fd, netbsd32_charp name, \ 418231 NOARGS { ssize_t|netbsd32||fgetxattr(int fd, netbsd32_charp name, \
419 netbsd32_voidp value, netbsd32_size_t size); } 419 netbsd32_voidp value, netbsd32_size_t size); }
420232 NOARGS { ssize_t|netbsd32||listxattr(netbsd32_charp path, \ 420232 NOARGS { ssize_t|netbsd32||listxattr(netbsd32_charp path, \
421 netbsd32_charp list, netbsd32_size_t size); } 421 netbsd32_charp list, netbsd32_size_t size); }
422233 NOARGS { ssize_t|netbsd32||llistxattr(netbsd32_charp path, \ 422233 NOARGS { ssize_t|netbsd32||llistxattr(netbsd32_charp path, \
423 netbsd32_charp list, netbsd32_size_t size); } 423 netbsd32_charp list, netbsd32_size_t size); }
424234 NOARGS { ssize_t|netbsd32||flistxattr(int fd, netbsd32_charp list, \ 424234 NOARGS { ssize_t|netbsd32||flistxattr(int fd, netbsd32_charp list, \
425 netbsd32_size_t size); } 425 netbsd32_size_t size); }
426235 NOARGS { int|netbsd32||removexattr(netbsd32_charp path, \ 426235 NOARGS { int|netbsd32||removexattr(netbsd32_charp path, \
427 netbsd32_charp name); } 427 netbsd32_charp name); }
428236 NOARGS { int|netbsd32||lremovexattr(netbsd32_charp path, \ 428236 NOARGS { int|netbsd32||lremovexattr(netbsd32_charp path, \
429 netbsd32_charp name); } 429 netbsd32_charp name); }
430237 NOARGS { int|netbsd32||fremovexattr(int fd, netbsd32_charp name); } 430237 NOARGS { int|netbsd32||fremovexattr(int fd, netbsd32_charp name); }
431238 STD { int|linux32_sys||tkill(int tid, int sig); } 431238 STD { int|linux32_sys||tkill(int tid, int sig); }
432239 UNIMPL sendfile64 432239 UNIMPL sendfile64
433240 STD { int|linux32_sys||futex(linux32_intp_t uaddr, int op, int val, \ 433240 STD { int|linux32_sys||futex(linux32_intp_t uaddr, int op, int val, \
434 linux32_timespecp_t timeout, linux32_intp_t uaddr2, \ 434 linux32_timespecp_t timeout, linux32_intp_t uaddr2, \
435 int val3); } 435 int val3); }
436241 STD { int|linux32_sys||sched_setaffinity(pid_t pid, \ 436241 STD { int|linux32_sys||sched_setaffinity(pid_t pid, \
437 unsigned int len, linux32_ulongp_t mask); } 437 unsigned int len, linux32_ulongp_t mask); }
438242 STD { int|linux32_sys||sched_getaffinity(pid_t pid, \ 438242 STD { int|linux32_sys||sched_getaffinity(pid_t pid, \
439 unsigned int len, linux32_ulongp_t mask); } 439 unsigned int len, linux32_ulongp_t mask); }
440243 STD { int|linux32_sys||set_thread_area(linux32_user_descp_t desc); } 440243 STD { int|linux32_sys||set_thread_area(linux32_user_descp_t desc); }
441244 STD { int|linux32_sys||get_thread_area(linux32_user_descp_t desc); } 441244 STD { int|linux32_sys||get_thread_area(linux32_user_descp_t desc); }
442245 UNIMPL io_setup 442245 UNIMPL io_setup
443246 UNIMPL io_destroy 443246 UNIMPL io_destroy
444247 UNIMPL io_getevents 444247 UNIMPL io_getevents
445248 UNIMPL io_submit 445248 UNIMPL io_submit
446249 UNIMPL io_cancel 446249 UNIMPL io_cancel
447250 STD { int|linux32_sys||fadvise64(int fd, uint32_t offlo, \ 447250 STD { int|linux32_sys||fadvise64(int fd, uint32_t offlo, \
448 uint32_t offhi, linux32_size_t len, int advice); } 448 uint32_t offhi, linux32_size_t len, int advice); }
449251 UNIMPL /* unused */ 449251 UNIMPL /* unused */
450252 STD { int|linux32_sys||exit_group(int error_code); } 450252 STD { int|linux32_sys||exit_group(int error_code); }
451253 UNIMPL lookup_dcookie 451253 UNIMPL lookup_dcookie
452254 UNIMPL epoll_create 452254 UNIMPL epoll_create
453255 UNIMPL epoll_ctl 453255 UNIMPL epoll_ctl
454256 UNIMPL epoll_wait 454256 UNIMPL epoll_wait
455257 UNIMPL remap_file_pages 455257 UNIMPL remap_file_pages
456258 STD { int|linux32_sys||set_tid_address(linux32_intp_t tid); } 456258 STD { int|linux32_sys||set_tid_address(linux32_intp_t tid); }
457259 STD { int|linux32_sys||timer_create(clockid_t clockid, \ 457259 STD { int|linux32_sys||timer_create(clockid_t clockid, \
458 struct linux32_sigevent *evp, timer_t *timerid); } 458 struct linux32_sigevent *evp, timer_t *timerid); }
459260 STD { int|linux32_sys||timer_settime(timer_t timerid, \ 459260 STD { int|linux32_sys||timer_settime(timer_t timerid, \
460 int flags, const struct linux32_itimerspec *tim, \ 460 int flags, const struct linux32_itimerspec *tim, \
461 struct linux32_itimerspec *otim); } 461 struct linux32_itimerspec *otim); }
462261 STD { int|linux32_sys||timer_gettime(timer_t timerid, \ 462261 STD { int|linux32_sys||timer_gettime(timer_t timerid, \
463 struct linux32_itimerspec *tim); } 463 struct linux32_itimerspec *tim); }
464262 NOARGS { int|sys||timer_getoverrun(timer_t timerid); } 464262 NOARGS { int|sys||timer_getoverrun(timer_t timerid); }
465263 NOARGS { int|sys||timer_delete(timer_t timerid); } 465263 NOARGS { int|sys||timer_delete(timer_t timerid); }
466264 STD { int|linux32_sys||clock_settime(clockid_t which, \ 466264 STD { int|linux32_sys||clock_settime(clockid_t which, \
467 linux32_timespecp_t tp); } 467 linux32_timespecp_t tp); }
468265 STD { int|linux32_sys||clock_gettime(clockid_t which, \ 468265 STD { int|linux32_sys||clock_gettime(clockid_t which, \
469 linux32_timespecp_t tp); } 469 linux32_timespecp_t tp); }
470266 STD { int|linux32_sys||clock_getres(clockid_t which, \ 470266 STD { int|linux32_sys||clock_getres(clockid_t which, \
471 linux32_timespecp_t tp); } 471 linux32_timespecp_t tp); }
472267 STD { int|linux32_sys||clock_nanosleep(clockid_t which, int flags, \ 472267 STD { int|linux32_sys||clock_nanosleep(clockid_t which, int flags, \
473 linux32_timespecp_t rqtp, linux32_timespecp_t rmtp); } 473 linux32_timespecp_t rqtp, linux32_timespecp_t rmtp); }
474268 STD { int|linux32_sys||statfs64(netbsd32_charp path, \ 474268 STD { int|linux32_sys||statfs64(netbsd32_charp path, \
475 netbsd32_size_t sz, linux32_statfs64p sp); } 475 netbsd32_size_t sz, linux32_statfs64p sp); }
476269 STD { int|linux32_sys||fstatfs64(int fd, \ 476269 STD { int|linux32_sys||fstatfs64(int fd, \
477 netbsd32_size_t sz, linux32_statfs64p sp); } 477 netbsd32_size_t sz, linux32_statfs64p sp); }
478270 STD { int|linux32_sys||tgkill(int tgid, int tid, int sig); } 478270 STD { int|linux32_sys||tgkill(int tgid, int tid, int sig); }
479271 NOARGS { int|compat_50_netbsd32||utimes(netbsd32_charp path, \ 479271 NOARGS { int|compat_50_netbsd32||utimes(netbsd32_charp path, \
480 netbsd32_timeval50p_t tptr); } 480 netbsd32_timeval50p_t tptr); }
481272 STD { int|linux32_sys||fadvise64_64(int fd, uint32_t offlo, \ 481272 STD { int|linux32_sys||fadvise64_64(int fd, uint32_t offlo, \
482 uint32_t offhi, uint32_t lenlo, uint32_t lenhi, int advice); } 482 uint32_t offhi, uint32_t lenlo, uint32_t lenhi, int advice); }
483273 UNIMPL vserver 483273 UNIMPL vserver
484274 UNIMPL mbind 484274 UNIMPL mbind
485275 UNIMPL get_mempolicy 485275 UNIMPL get_mempolicy
486276 UNIMPL set_mempolicy 486276 UNIMPL set_mempolicy
487277 UNIMPL mq_open 487277 UNIMPL mq_open
488278 UNIMPL mq_unlink 488278 UNIMPL mq_unlink
489279 UNIMPL mq_timedsend 489279 UNIMPL mq_timedsend
490280 UNIMPL mq_timedreceive 490280 UNIMPL mq_timedreceive
491281 UNIMPL mq_notify 491281 UNIMPL mq_notify
492282 UNIMPL mq_getsetattr 492282 UNIMPL mq_getsetattr
493283 UNIMPL kexec_load 493283 UNIMPL kexec_load
494284 UNIMPL waitid 494284 UNIMPL waitid
495285 UNIMPL /* unused */ 495285 UNIMPL /* unused */
496286 UNIMPL add_key 496286 UNIMPL add_key
497287 UNIMPL request_key 497287 UNIMPL request_key
498288 UNIMPL keyctl 498288 UNIMPL keyctl
499289 UNIMPL ioprio_set 499289 UNIMPL ioprio_set
500290 UNIMPL ioprio_get 500290 UNIMPL ioprio_get
501291 UNIMPL inotify_init 501291 UNIMPL inotify_init
502292 UNIMPL inotify_add_watch 502292 UNIMPL inotify_add_watch
503293 UNIMPL inotify_rm_watch 503293 UNIMPL inotify_rm_watch
504294 UNIMPL migrate_pages 504294 UNIMPL migrate_pages
505295 STD { int|linux32_sys||openat(int fd, netbsd32_charp path, \ 505295 STD { int|linux32_sys||openat(int fd, netbsd32_charp path, \
506 int flags, ... linux_umode_t mode); } 506 int flags, ... linux_umode_t mode); }
507296 NOARGS { int|netbsd32||mkdirat(int fd, netbsd32_charp path, \ 507296 NOARGS { int|netbsd32||mkdirat(int fd, netbsd32_charp path, \
508 linux_umode_t mode); } 508 linux_umode_t mode); }
509297 STD { int|linux32_sys||mknodat(int fd, netbsd32_charp path, \ 509297 STD { int|linux32_sys||mknodat(int fd, netbsd32_charp path, \
510 linux_umode_t mode, unsigned dev); } 510 linux_umode_t mode, unsigned dev); }
511298 STD { int|linux32_sys||fchownat(int fd, netbsd32_charp path, \ 511298 STD { int|linux32_sys||fchownat(int fd, netbsd32_charp path, \
512 uid_t owner, gid_t group, int flag); } 512 uid_t owner, gid_t group, int flag); }
513299 UNIMPL futimesat 513299 UNIMPL futimesat
514300 STD { int|linux32_sys||fstatat64(int fd, netbsd32_charp path, \ 514300 STD { int|linux32_sys||fstatat64(int fd, netbsd32_charp path, \
515 linux32_stat64p sp, int flag); } 515 linux32_stat64p sp, int flag); }
516301 STD { int|linux32_sys||unlinkat(int fd, netbsd32_charp path, \ 516301 STD { int|linux32_sys||unlinkat(int fd, netbsd32_charp path, \
517 int flag); } 517 int flag); }
518302 NOARGS { int|netbsd32||renameat(int fromfd, netbsd32_charp from, \ 518302 NOARGS { int|netbsd32||renameat(int fromfd, netbsd32_charp from, \
519 int tofd, netbsd32_charp to); } 519 int tofd, netbsd32_charp to); }
520303 STD { int|linux32_sys||linkat(int fd1, netbsd32_charp name1, \ 520303 STD { int|linux32_sys||linkat(int fd1, netbsd32_charp name1, \
521 int fd2, netbsd32_charp name2, int flags); } 521 int fd2, netbsd32_charp name2, int flags); }
522304 NOARGS { int|netbsd32||symlinkat(netbsd32_charp path1, int fd, \ 522304 NOARGS { int|netbsd32||symlinkat(netbsd32_charp path1, int fd, \
523 netbsd32_charp path2); } 523 netbsd32_charp path2); }
524305 NOARGS { int|netbsd32||readlinkat(int fd, netbsd32_charp path, \ 524305 NOARGS { int|netbsd32||readlinkat(int fd, netbsd32_charp path, \
525 netbsd32_charp buf, linux32_size_t bufsize); } 525 netbsd32_charp buf, linux32_size_t bufsize); }
526306 STD { int|linux32_sys||fchmodat(int fd, netbsd32_charp path, \ 526306 STD { int|linux32_sys||fchmodat(int fd, netbsd32_charp path, \
527 linux_umode_t mode); } 527 linux_umode_t mode); }
528307 STD { int|linux32_sys||faccessat(int fd, netbsd32_charp path, \ 528307 STD { int|linux32_sys||faccessat(int fd, netbsd32_charp path, \
529 int amode); } 529 int amode); }
530308 UNIMPL pselect6 530308 UNIMPL pselect6
531309 STD { int|linux32_sys||ppoll(netbsd32_pollfdp_t fds, u_int nfds, \ 531309 STD { int|linux32_sys||ppoll(netbsd32_pollfdp_t fds, u_int nfds, \
532 linux32_timespecp_t timeout, linux32_sigsetp_t sigset); } 532 linux32_timespecp_t timeout, linux32_sigsetp_t sigset); }
533310 UNIMPL unshare 533310 UNIMPL unshare
534 ; 534 ;
535 ; The netbsd32 native robust list calls have different 535 ; The netbsd32 native robust list calls have different
536 ; argument names / types, but they are ABI-compatible 536 ; argument names / types, but they are ABI-compatible
537 ; with linux32. 537 ; with linux32.
538 ; 538 ;
539311 NOARGS { int|netbsd32||__futex_set_robust_list( \ 539311 NOARGS { int|netbsd32||__futex_set_robust_list( \
540 netbsd32_voidp head, netbsd32_size_t len); } 540 netbsd32_voidp head, netbsd32_size_t len); }
541312 NOARGS { int|netbsd32||__futex_get_robust_list(lwpid_t lwpid, \ 541312 NOARGS { int|netbsd32||__futex_get_robust_list(lwpid_t lwpid, \
542 netbsd32_voidp headp, netbsd32_size_tp lenp); } 542 netbsd32_voidp headp, netbsd32_size_tp lenp); }
543313 UNIMPL splice 543313 UNIMPL splice
544314 UNIMPL sync_file_range 544314 UNIMPL sync_file_range
545315 UNIMPL tee 545315 UNIMPL tee
546316 UNIMPL vmsplice 546316 UNIMPL vmsplice
547317 UNIMPL move_pages 547317 UNIMPL move_pages
548318 UNIMPL getcpu 548318 UNIMPL getcpu
549319 UNIMPL epoll_wait 549319 UNIMPL epoll_wait
550320 STD { int|linux32_sys||utimensat(int fd, netbsd32_charp path, \ 550320 STD { int|linux32_sys||utimensat(int fd, netbsd32_charp path, \
551 linux32_timespecp_t times, int flag); } 551 linux32_timespecp_t times, int flag); }
552321 UNIMPL signalfd 552321 UNIMPL signalfd
553322 NOARGS { int|linux_sys||timerfd_create(clockid_t clock_id, \ 553322 NOARGS { int|linux_sys||timerfd_create(clockid_t clock_id, \
554 int flags); } 554 int flags); }
555323 STD { int|linux32_sys||eventfd(unsigned int initval); } 555323 STD { int|linux32_sys||eventfd(unsigned int initval); }
556324 STD { int|linux32_sys||fallocate(int fd, int mode, \ 556324 STD { int|linux32_sys||fallocate(int fd, int mode, \
557 off_t offset, off_t len); } 557 off_t offset, off_t len); }
558325 STD { int|linux32_sys||timerfd_settime(int fd, int flags, \ 558325 STD { int|linux32_sys||timerfd_settime(int fd, int flags, \
559 const struct linux32_itimerspec *new_value, \ 559 const struct linux32_itimerspec *new_value, \
560 struct linux32_itimerspec *old_value); } 560 struct linux32_itimerspec *old_value); }
561326 STD { int|linux32_sys||timerfd_gettime(int fd, \ 561326 STD { int|linux32_sys||timerfd_gettime(int fd, \
562 struct linux32_itimerspec *curr_value); } 562 struct linux32_itimerspec *curr_value); }
563327 UNIMPL signalfd4 563327 UNIMPL signalfd4
564328 STD { int|linux32_sys||eventfd2(unsigned int initval, \ 564328 STD { int|linux32_sys||eventfd2(unsigned int initval, \
565 int flags); } 565 int flags); }
566329 UNIMPL epoll_create1 566329 UNIMPL epoll_create1
567330 STD { int|linux32_sys||dup3(int from, int to, int flags); } 567330 STD { int|linux32_sys||dup3(int from, int to, int flags); }
568331 STD { int|linux32_sys||pipe2(netbsd32_intp fd, int flags); } 568331 STD { int|linux32_sys||pipe2(netbsd32_intp fd, int flags); }
569332 UNIMPL inotify_init1 569332 UNIMPL inotify_init1
570333 UNIMPL preadv 570333 STD { int|linux32_sys||preadv(int fd, \
571334 UNIMPL pwritev 571 const netbsd32_iovecp_t iovp, int iovcnt, \
 572 netbsd32_u_long off_lo, netbsd32_u_long off_hi); }
 573334 STD { int|linux32_sys||pwritev(int fd, \
 574 const netbsd32_iovecp_t iovp, int iovcnt, \
 575 netbsd32_u_long off_lo, netbsd32_u_long off_hi); }
572335 UNIMPL rt_tgsigqueueinfo 576335 UNIMPL rt_tgsigqueueinfo
573336 UNIMPL perf_counter_open 577336 UNIMPL perf_counter_open
574337 UNIMPL recvmmsg 578337 UNIMPL recvmmsg
575338 UNIMPL fanotify_init 579338 UNIMPL fanotify_init
576339 UNIMPL fanotify_mark 580339 UNIMPL fanotify_mark
577340 UNIMPL prlimit64 581340 UNIMPL prlimit64
578341 UNIMPL name_to_handle_at 582341 UNIMPL name_to_handle_at
579342 UNIMPL open_by_handle_at 583342 UNIMPL open_by_handle_at
580343 UNIMPL clock_adjtime 584343 UNIMPL clock_adjtime
581344 UNIMPL syncfs 585344 UNIMPL syncfs
582345 UNIMPL sendmmsg 586345 UNIMPL sendmmsg
583346 UNIMPL setns 587346 UNIMPL setns
584347 UNIMPL process_vm_readv 588347 UNIMPL process_vm_readv
585348 UNIMPL process_vm_writev 589348 UNIMPL process_vm_writev
586349 UNIMPL kcmp 590349 UNIMPL kcmp
587350 UNIMPL finit_module 591350 UNIMPL finit_module

cvs diff -r1.30.2.2 -r1.30.2.3 src/sys/compat/linux32/common/linux32_misc.c (switch to unified diff)

--- src/sys/compat/linux32/common/linux32_misc.c 2020/12/17 03:02:06 1.30.2.2
+++ src/sys/compat/linux32/common/linux32_misc.c 2021/01/03 16:12:44 1.30.2.3
@@ -1,382 +1,432 @@ @@ -1,382 +1,432 @@
1/* $NetBSD: linux32_misc.c,v 1.30.2.2 2020/12/17 03:02:06 thorpej Exp $ */ 1/* $NetBSD: linux32_misc.c,v 1.30.2.3 2021/01/03 16:12:44 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe 8 * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe
9 * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center; 9 * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center;
10 * by Edgar Fu\ss, Mathematisches Institut der Uni Bonn. 10 * by Edgar Fu\ss, Mathematisches Institut der Uni Bonn.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
15 * 1. Redistributions of source code must retain the above copyright 15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer. 16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright 17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the 18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution. 19 * documentation and/or other materials provided with the distribution.
20 * 20 *
21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30.2.2 2020/12/17 03:02:06 thorpej Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30.2.3 2021/01/03 16:12:44 thorpej Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/proc.h> 38#include <sys/proc.h>
39#include <sys/time.h> 39#include <sys/time.h>
40#include <sys/types.h> 40#include <sys/types.h>
41#include <sys/fstypes.h> 41#include <sys/fstypes.h>
42#include <sys/vfs_syscalls.h> 42#include <sys/vfs_syscalls.h>
43#include <sys/ptrace.h> 43#include <sys/ptrace.h>
44#include <sys/syscall.h> 44#include <sys/syscall.h>
45#include <sys/poll.h> 45#include <sys/poll.h>
46#include <sys/futex.h> 46#include <sys/futex.h>
47 47
48#include <compat/netbsd32/netbsd32.h> 48#include <compat/netbsd32/netbsd32.h>
49#include <compat/netbsd32/netbsd32_syscallargs.h> 49#include <compat/netbsd32/netbsd32_syscallargs.h>
50 50
51#include <compat/linux/common/linux_types.h> 51#include <compat/linux/common/linux_types.h>
52 52
53#include <compat/linux32/common/linux32_types.h> 53#include <compat/linux32/common/linux32_types.h>
54#include <compat/linux32/common/linux32_signal.h> 54#include <compat/linux32/common/linux32_signal.h>
55#include <compat/linux32/common/linux32_sched.h> 55#include <compat/linux32/common/linux32_sched.h>
56#include <compat/linux32/linux32_syscallargs.h> 56#include <compat/linux32/linux32_syscallargs.h>
57 57
58#include <compat/linux/common/linux_ptrace.h> 58#include <compat/linux/common/linux_ptrace.h>
59#include <compat/linux/common/linux_emuldata.h> 59#include <compat/linux/common/linux_emuldata.h>
60#include <compat/linux/common/linux_signal.h> 60#include <compat/linux/common/linux_signal.h>
61#include <compat/linux/common/linux_misc.h> 61#include <compat/linux/common/linux_misc.h>
62#include <compat/linux/common/linux_statfs.h> 62#include <compat/linux/common/linux_statfs.h>
63#include <compat/linux/common/linux_ipc.h> 63#include <compat/linux/common/linux_ipc.h>
64#include <compat/linux/common/linux_sem.h> 64#include <compat/linux/common/linux_sem.h>
65#include <compat/linux/linux_syscallargs.h> 65#include <compat/linux/linux_syscallargs.h>
66 66
67extern const struct linux_mnttypes linux_fstypes[]; 67extern const struct linux_mnttypes linux_fstypes[];
68extern const int linux_fstypes_cnt; 68extern const int linux_fstypes_cnt;
69 69
70/* 70/*
71 * Implement the fs stat functions. Straightforward. 71 * Implement the fs stat functions. Straightforward.
72 */ 72 */
73int 73int
74linux32_sys_statfs(struct lwp *l, const struct linux32_sys_statfs_args *uap, register_t *retval) 74linux32_sys_statfs(struct lwp *l, const struct linux32_sys_statfs_args *uap, register_t *retval)
75{ 75{
76 /* { 76 /* {
77 syscallarg(const netbsd32_charp char) path; 77 syscallarg(const netbsd32_charp char) path;
78 syscallarg(linux32_statfsp) sp; 78 syscallarg(linux32_statfsp) sp;
79 } */ 79 } */
80 struct statvfs *sb; 80 struct statvfs *sb;
81 struct linux_statfs ltmp; 81 struct linux_statfs ltmp;
82 int error; 82 int error;
83 83
84 sb = STATVFSBUF_GET(); 84 sb = STATVFSBUF_GET();
85 error = do_sys_pstatvfs(l, SCARG_P32(uap, path), ST_WAIT, sb); 85 error = do_sys_pstatvfs(l, SCARG_P32(uap, path), ST_WAIT, sb);
86 if (error == 0) { 86 if (error == 0) {
87 bsd_to_linux_statfs(sb, &ltmp); 87 bsd_to_linux_statfs(sb, &ltmp);
88 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp); 88 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp);
89 } 89 }
90 90
91 STATVFSBUF_PUT(sb); 91 STATVFSBUF_PUT(sb);
92 return error; 92 return error;
93} 93}
94 94
95int 95int
96linux32_sys_fstatfs(struct lwp *l, const struct linux32_sys_fstatfs_args *uap, register_t *retval) 96linux32_sys_fstatfs(struct lwp *l, const struct linux32_sys_fstatfs_args *uap, register_t *retval)
97{ 97{
98 /* { 98 /* {
99 syscallarg(int) fd; 99 syscallarg(int) fd;
100 syscallarg(linux32_statfsp) sp; 100 syscallarg(linux32_statfsp) sp;
101 } */ 101 } */
102 struct statvfs *sb; 102 struct statvfs *sb;
103 struct linux_statfs ltmp; 103 struct linux_statfs ltmp;
104 int error; 104 int error;
105 105
106 sb = STATVFSBUF_GET(); 106 sb = STATVFSBUF_GET();
107 error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb); 107 error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
108 if (error == 0) { 108 if (error == 0) {
109 bsd_to_linux_statfs(sb, &ltmp); 109 bsd_to_linux_statfs(sb, &ltmp);
110 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp); 110 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp);
111 } 111 }
112 STATVFSBUF_PUT(sb); 112 STATVFSBUF_PUT(sb);
113 113
114 return error; 114 return error;
115} 115}
116 116
117int 117int
118linux32_sys_statfs64(struct lwp *l, const struct linux32_sys_statfs64_args *uap, register_t *retval) 118linux32_sys_statfs64(struct lwp *l, const struct linux32_sys_statfs64_args *uap, register_t *retval)
119{ 119{
120 /* { 120 /* {
121 syscallarg(const netbsd32_charp char) path; 121 syscallarg(const netbsd32_charp char) path;
122 syscallarg(linux32_statfs64p) sp; 122 syscallarg(linux32_statfs64p) sp;
123 } */ 123 } */
124 struct statvfs *sb; 124 struct statvfs *sb;
125 struct linux_statfs64 ltmp; 125 struct linux_statfs64 ltmp;
126 int error; 126 int error;
127 127
128 sb = STATVFSBUF_GET(); 128 sb = STATVFSBUF_GET();
129 error = do_sys_pstatvfs(l, SCARG_P32(uap, path), ST_WAIT, sb); 129 error = do_sys_pstatvfs(l, SCARG_P32(uap, path), ST_WAIT, sb);
130 if (error == 0) { 130 if (error == 0) {
131 bsd_to_linux_statfs64(sb, &ltmp); 131 bsd_to_linux_statfs64(sb, &ltmp);
132 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp); 132 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp);
133 } 133 }
134 134
135 STATVFSBUF_PUT(sb); 135 STATVFSBUF_PUT(sb);
136 return error; 136 return error;
137} 137}
138 138
139int 139int
140linux32_sys_fstatfs64(struct lwp *l, const struct linux32_sys_fstatfs64_args *uap, register_t *retval) 140linux32_sys_fstatfs64(struct lwp *l, const struct linux32_sys_fstatfs64_args *uap, register_t *retval)
141{ 141{
142 /* { 142 /* {
143 syscallarg(int) fd; 143 syscallarg(int) fd;
144 syscallarg(linux32_statfs64p) sp; 144 syscallarg(linux32_statfs64p) sp;
145 } */ 145 } */
146 struct statvfs *sb; 146 struct statvfs *sb;
147 struct linux_statfs64 ltmp; 147 struct linux_statfs64 ltmp;
148 int error; 148 int error;
149 149
150 sb = STATVFSBUF_GET(); 150 sb = STATVFSBUF_GET();
151 error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb); 151 error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
152 if (error == 0) { 152 if (error == 0) {
153 bsd_to_linux_statfs64(sb, &ltmp); 153 bsd_to_linux_statfs64(sb, &ltmp);
154 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp); 154 error = copyout(&ltmp, SCARG_P32(uap, sp), sizeof ltmp);
155 } 155 }
156 STATVFSBUF_PUT(sb); 156 STATVFSBUF_PUT(sb);
157 157
158 return error; 158 return error;
159} 159}
160 160
161extern const int linux_ptrace_request_map[]; 161extern const int linux_ptrace_request_map[];
162 162
163int 163int
164linux32_sys_ptrace(struct lwp *l, const struct linux32_sys_ptrace_args *uap, register_t *retval) 164linux32_sys_ptrace(struct lwp *l, const struct linux32_sys_ptrace_args *uap, register_t *retval)
165{ 165{
166 /* { 166 /* {
167 i386, m68k, powerpc: T=int 167 i386, m68k, powerpc: T=int
168 alpha, amd64: T=long 168 alpha, amd64: T=long
169 syscallarg(T) request; 169 syscallarg(T) request;
170 syscallarg(T) pid; 170 syscallarg(T) pid;
171 syscallarg(T) addr; 171 syscallarg(T) addr;
172 syscallarg(T) data; 172 syscallarg(T) data;
173 } */ 173 } */
174 const int *ptr; 174 const int *ptr;
175 int request; 175 int request;
176 int error; 176 int error;
177 177
178 ptr = linux_ptrace_request_map; 178 ptr = linux_ptrace_request_map;
179 request = SCARG(uap, request); 179 request = SCARG(uap, request);
180 while (*ptr != -1) 180 while (*ptr != -1)
181 if (*ptr++ == request) { 181 if (*ptr++ == request) {
182 struct sys_ptrace_args pta; 182 struct sys_ptrace_args pta;
183 183
184 SCARG(&pta, req) = *ptr; 184 SCARG(&pta, req) = *ptr;
185 SCARG(&pta, pid) = SCARG(uap, pid); 185 SCARG(&pta, pid) = SCARG(uap, pid);
186 SCARG(&pta, addr) = NETBSD32IPTR64(SCARG(uap, addr)); 186 SCARG(&pta, addr) = NETBSD32IPTR64(SCARG(uap, addr));
187 SCARG(&pta, data) = SCARG(uap, data); 187 SCARG(&pta, data) = SCARG(uap, data);
188 188
189 /* 189 /*
190 * Linux ptrace(PTRACE_CONT, pid, 0, 0) means actually 190 * Linux ptrace(PTRACE_CONT, pid, 0, 0) means actually
191 * to continue where the process left off previously. 191 * to continue where the process left off previously.
192 * The same thing is achieved by addr == (void *) 1 192 * The same thing is achieved by addr == (void *) 1
193 * on NetBSD, so rewrite 'addr' appropriately. 193 * on NetBSD, so rewrite 'addr' appropriately.
194 */ 194 */
195 if (request == LINUX_PTRACE_CONT && SCARG(uap, addr)==0) 195 if (request == LINUX_PTRACE_CONT && SCARG(uap, addr)==0)
196 SCARG(&pta, addr) = (void *) 1; 196 SCARG(&pta, addr) = (void *) 1;
197 197
198 error = sysent[SYS_ptrace].sy_call(l, &pta, retval); 198 error = sysent[SYS_ptrace].sy_call(l, &pta, retval);
199 if (error) 199 if (error)
200 return error; 200 return error;
201 switch (request) { 201 switch (request) {
202 case LINUX_PTRACE_PEEKTEXT: 202 case LINUX_PTRACE_PEEKTEXT:
203 case LINUX_PTRACE_PEEKDATA: 203 case LINUX_PTRACE_PEEKDATA:
204 error = copyout (retval, 204 error = copyout (retval,
205 NETBSD32IPTR64(SCARG(uap, data)),  205 NETBSD32IPTR64(SCARG(uap, data)),
206 sizeof *retval); 206 sizeof *retval);
207 *retval = SCARG(uap, data); 207 *retval = SCARG(uap, data);
208 break; 208 break;
209 default: 209 default:
210 break; 210 break;
211 } 211 }
212 return error; 212 return error;
213 } 213 }
214 else 214 else
215 ptr++; 215 ptr++;
216 216
217 return EIO; 217 return EIO;
218} 218}
219 219
220int 220int
221linux32_sys_personality(struct lwp *l, const struct linux32_sys_personality_args *uap, register_t *retval) 221linux32_sys_personality(struct lwp *l, const struct linux32_sys_personality_args *uap, register_t *retval)
222{ 222{
223 /* { 223 /* {
224 syscallarg(netbsd32_u_long) per; 224 syscallarg(netbsd32_u_long) per;
225 } */ 225 } */
226 struct linux_sys_personality_args ua; 226 struct linux_sys_personality_args ua;
227 227
228 NETBSD32TOX_UAP(per, long); 228 NETBSD32TOX_UAP(per, long);
229 return linux_sys_personality(l, &ua, retval); 229 return linux_sys_personality(l, &ua, retval);
230} 230}
231 231
232int 232int
233linux32_sys_futex(struct lwp *l, 233linux32_sys_futex(struct lwp *l,
234 const struct linux32_sys_futex_args *uap, register_t *retval) 234 const struct linux32_sys_futex_args *uap, register_t *retval)
235{ 235{
236 /* { 236 /* {
237 syscallarg(linux32_intp_t) uaddr; 237 syscallarg(linux32_intp_t) uaddr;
238 syscallarg(int) op; 238 syscallarg(int) op;
239 syscallarg(int) val; 239 syscallarg(int) val;
240 syscallarg(linux32_timespecp_t) timeout; 240 syscallarg(linux32_timespecp_t) timeout;
241 syscallarg(linux32_intp_t) uaddr2; 241 syscallarg(linux32_intp_t) uaddr2;
242 syscallarg(int) val3; 242 syscallarg(int) val3;
243 } */ 243 } */
244 struct linux32_timespec lts; 244 struct linux32_timespec lts;
245 struct timespec ts, *tsp = NULL; 245 struct timespec ts, *tsp = NULL;
246 int val2 = 0; 246 int val2 = 0;
247 int error; 247 int error;
248 248
249 /* 249 /*
250 * Linux overlays the "timeout" field and the "val2" field. 250 * Linux overlays the "timeout" field and the "val2" field.
251 * "timeout" is only valid for FUTEX_WAIT and FUTEX_WAIT_BITSET 251 * "timeout" is only valid for FUTEX_WAIT and FUTEX_WAIT_BITSET
252 * on Linux. 252 * on Linux.
253 */ 253 */
254 const int op = (SCARG(uap, op) & FUTEX_CMD_MASK); 254 const int op = (SCARG(uap, op) & FUTEX_CMD_MASK);
255 if ((op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET) && 255 if ((op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET) &&
256 SCARG_P32(uap, timeout) != NULL) { 256 SCARG_P32(uap, timeout) != NULL) {
257 if ((error = copyin(SCARG_P32(uap, timeout), 257 if ((error = copyin(SCARG_P32(uap, timeout),
258 &lts, sizeof(lts))) != 0) { 258 &lts, sizeof(lts))) != 0) {
259 return error; 259 return error;
260 } 260 }
261 linux32_to_native_timespec(&ts, &lts); 261 linux32_to_native_timespec(&ts, &lts);
262 tsp = &ts; 262 tsp = &ts;
263 } else { 263 } else {
264 val2 = (int)(uintptr_t)SCARG_P32(uap, timeout); 264 val2 = (int)(uintptr_t)SCARG_P32(uap, timeout);
265 } 265 }
266 266
267 return linux_do_futex(SCARG_P32(uap, uaddr), SCARG(uap, op), 267 return linux_do_futex(SCARG_P32(uap, uaddr), SCARG(uap, op),
268 SCARG(uap, val), tsp, SCARG_P32(uap, uaddr2), val2, 268 SCARG(uap, val), tsp, SCARG_P32(uap, uaddr2), val2,
269 SCARG(uap, val3), retval); 269 SCARG(uap, val3), retval);
270} 270}
271 271
272int 272int
273linux32_sys_truncate64(struct lwp *l, const struct linux32_sys_truncate64_args *uap, register_t *retval) 273linux32_sys_truncate64(struct lwp *l, const struct linux32_sys_truncate64_args *uap, register_t *retval)
274{ 274{
275 /* { 275 /* {
276 syscallarg(netbsd32_charp) path; 276 syscallarg(netbsd32_charp) path;
277 syscallarg(off_t) length; 277 syscallarg(off_t) length;
278 } */ 278 } */
279 struct sys_truncate_args ua; 279 struct sys_truncate_args ua;
280 280
281 /* Linux doesn't have the 'pad' pseudo-parameter */ 281 /* Linux doesn't have the 'pad' pseudo-parameter */
282 NETBSD32TOP_UAP(path, const char *); 282 NETBSD32TOP_UAP(path, const char *);
283 SCARG(&ua, PAD) = 0; 283 SCARG(&ua, PAD) = 0;
284 SCARG(&ua, length) = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo); 284 SCARG(&ua, length) = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo);
285 return sys_truncate(l, &ua, retval); 285 return sys_truncate(l, &ua, retval);
286} 286}
287 287
288int 288int
289linux32_sys_ftruncate64(struct lwp *l, const struct linux32_sys_ftruncate64_args *uap, register_t *retval) 289linux32_sys_ftruncate64(struct lwp *l, const struct linux32_sys_ftruncate64_args *uap, register_t *retval)
290{ 290{
291 /* { 291 /* {
292 syscallarg(unsigned int) fd; 292 syscallarg(unsigned int) fd;
293 syscallarg(off_t) length; 293 syscallarg(off_t) length;
294 } */ 294 } */
295 struct sys_ftruncate_args ua; 295 struct sys_ftruncate_args ua;
296 296
297 /* Linux doesn't have the 'pad' pseudo-parameter */ 297 /* Linux doesn't have the 'pad' pseudo-parameter */
298 NETBSD32TO64_UAP(fd); 298 NETBSD32TO64_UAP(fd);
299 SCARG(&ua, PAD) = 0; 299 SCARG(&ua, PAD) = 0;
300 SCARG(&ua, length) = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo); 300 SCARG(&ua, length) = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo);
301 return sys_ftruncate(l, &ua, retval); 301 return sys_ftruncate(l, &ua, retval);
302} 302}
303 303
304int 304int
305linux32_sys_setdomainname(struct lwp *l, const struct linux32_sys_setdomainname_args *uap, register_t *retval) 305linux32_sys_setdomainname(struct lwp *l, const struct linux32_sys_setdomainname_args *uap, register_t *retval)
306{ 306{
307 /* { 307 /* {
308 syscallarg(netbsd32_charp) domainname; 308 syscallarg(netbsd32_charp) domainname;
309 syscallarg(int) len; 309 syscallarg(int) len;
310 } */ 310 } */
311 struct linux_sys_setdomainname_args ua; 311 struct linux_sys_setdomainname_args ua;
312 312
313 NETBSD32TOP_UAP(domainname, char); 313 NETBSD32TOP_UAP(domainname, char);
314 NETBSD32TO64_UAP(len); 314 NETBSD32TO64_UAP(len);
315 return linux_sys_setdomainname(l, &ua, retval); 315 return linux_sys_setdomainname(l, &ua, retval);
316} 316}
317 317
318int 318int
319linux32_sys_ppoll(struct lwp *l, const struct linux32_sys_ppoll_args *uap, 319linux32_sys_ppoll(struct lwp *l, const struct linux32_sys_ppoll_args *uap,
320 register_t *retval) 320 register_t *retval)
321{ 321{
322 /* { 322 /* {
323 syscallarg(netbsd32_pollfdp_t) fds; 323 syscallarg(netbsd32_pollfdp_t) fds;
324 syscallarg(u_int) nfds; 324 syscallarg(u_int) nfds;
325 syscallarg(linux32_timespecp_t) timeout; 325 syscallarg(linux32_timespecp_t) timeout;
326 syscallarg(linux32_sigsetp_t) sigset; 326 syscallarg(linux32_sigsetp_t) sigset;
327 } */ 327 } */
328 struct linux32_timespec lts0, *lts; 328 struct linux32_timespec lts0, *lts;
329 struct timespec ts0, *ts = NULL; 329 struct timespec ts0, *ts = NULL;
330 linux32_sigset_t lsigmask0, *lsigmask; 330 linux32_sigset_t lsigmask0, *lsigmask;
331 sigset_t sigmask0, *sigmask = NULL; 331 sigset_t sigmask0, *sigmask = NULL;
332 int error; 332 int error;
333 333
334 lts = SCARG_P32(uap, timeout); 334 lts = SCARG_P32(uap, timeout);
335 if (lts) { 335 if (lts) {
336 if ((error = copyin(lts, &lts0, sizeof(lts0))) != 0) 336 if ((error = copyin(lts, &lts0, sizeof(lts0))) != 0)
337 return error; 337 return error;
338 linux32_to_native_timespec(&ts0, &lts0); 338 linux32_to_native_timespec(&ts0, &lts0);
339 ts = &ts0; 339 ts = &ts0;
340 } 340 }
341 341
342 lsigmask = SCARG_P32(uap, sigset); 342 lsigmask = SCARG_P32(uap, sigset);
343 if (lsigmask) { 343 if (lsigmask) {
344 if ((error = copyin(lsigmask, &lsigmask0, sizeof(lsigmask0)))) 344 if ((error = copyin(lsigmask, &lsigmask0, sizeof(lsigmask0))))
345 return error; 345 return error;
346 linux32_to_native_sigset(&sigmask0, &lsigmask0); 346 linux32_to_native_sigset(&sigmask0, &lsigmask0);
347 sigmask = &sigmask0; 347 sigmask = &sigmask0;
348 } 348 }
349 349
350 return pollcommon(retval, SCARG_P32(uap, fds), SCARG(uap, nfds), 350 return pollcommon(retval, SCARG_P32(uap, fds), SCARG(uap, nfds),
351 ts, sigmask); 351 ts, sigmask);
352} 352}
353 353
354int 354int
355linux32_sys_eventfd(struct lwp *l, const struct linux32_sys_eventfd_args *uap, 355linux32_sys_eventfd(struct lwp *l, const struct linux32_sys_eventfd_args *uap,
356 register_t *retval) 356 register_t *retval)
357{ 357{
358 /* { 358 /* {
359 syscallarg(unsigned int) initval; 359 syscallarg(unsigned int) initval;
360 } */ 360 } */
361 struct linux_sys_eventfd_args ua; 361 struct linux_sys_eventfd_args ua;
362 362
363 NETBSD32TO64_UAP(initval); 363 NETBSD32TO64_UAP(initval);
364 364
365 return linux_sys_eventfd(l, &ua, retval); 365 return linux_sys_eventfd(l, &ua, retval);
366} 366}
367 367
368int 368int
369linux32_sys_eventfd2(struct lwp *l, const struct linux32_sys_eventfd2_args *uap, 369linux32_sys_eventfd2(struct lwp *l, const struct linux32_sys_eventfd2_args *uap,
370 register_t *retval) 370 register_t *retval)
371{ 371{
372 /* { 372 /* {
373 syscallarg(unsigned int) initval; 373 syscallarg(unsigned int) initval;
374 syscallarg(int) flags; 374 syscallarg(int) flags;
375 } */ 375 } */
376 struct linux_sys_eventfd2_args ua; 376 struct linux_sys_eventfd2_args ua;
377 377
378 NETBSD32TO64_UAP(initval); 378 NETBSD32TO64_UAP(initval);
379 NETBSD32TO64_UAP(flags); 379 NETBSD32TO64_UAP(flags);
380 380
381 return linux_sys_eventfd2(l, &ua, retval); 381 return linux_sys_eventfd2(l, &ua, retval);
382} 382}
 383
 384static inline off_t
 385linux32_hilo_to_off_t(unsigned long hi, unsigned long lo)
 386{
 387 return (((off_t)hi) << 32) | lo;
 388}
 389
 390int
 391linux32_sys_preadv(struct lwp *l, const struct linux32_sys_preadv_args *uap,
 392 register_t *retval)
 393{
 394 /* {
 395 syscallarg(int) fd;
 396 syscallarg(const netbsd32_iovecp_t) iovp;
 397 syscallarg(int) iovcnt;
 398 syscallarg(netbsd32_u_long) off_lo;
 399 syscallarg(netbsd32_u_long) off_hi;
 400 } */
 401 struct netbsd32_preadv_args ua;
 402
 403 SCARG(&ua, fd) = SCARG(uap, fd);
 404 SCARG(&ua, iovp) = SCARG(uap, iovp);
 405 SCARG(&ua, iovcnt) = SCARG(uap, iovcnt);
 406 SCARG(&ua, PAD) = 0;
 407 SCARG(&ua, offset) = linux32_hilo_to_off_t(SCARG(uap, off_hi),
 408 SCARG(uap, off_lo));
 409 return netbsd32_preadv(l, &ua, retval);
 410}
 411
 412int
 413linux32_sys_pwritev(struct lwp *l, const struct linux32_sys_pwritev_args *uap,
 414 register_t *retval)
 415{
 416 /* {
 417 syscallarg(int) fd;
 418 syscallarg(const netbsd32_iovecp_t) iovp;
 419 syscallarg(int) iovcnt;
 420 syscallarg(netbsd32_u_long) off_lo;
 421 syscallarg(netbsd32_u_long) off_hi;
 422 } */
 423 struct netbsd32_pwritev_args ua;
 424
 425 SCARG(&ua, fd) = SCARG(uap, fd);
 426 SCARG(&ua, iovp) = SCARG(uap, iovp);
 427 SCARG(&ua, iovcnt) = SCARG(uap, iovcnt);
 428 SCARG(&ua, PAD) = 0;
 429 SCARG(&ua, offset) = linux32_hilo_to_off_t(SCARG(uap, off_hi),
 430 SCARG(uap, off_lo));
 431 return netbsd32_pwritev(l, &ua, retval);
 432}