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 (expand / 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,14 +1,14 @@ @@ -1,14 +1,14 @@
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
@@ -557,28 +557,32 @@ @@ -557,28 +557,32 @@
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

cvs diff -r1.30.2.2 -r1.30.2.3 src/sys/compat/linux32/common/linux32_misc.c (expand / 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,14 +1,14 @@ @@ -1,14 +1,14 @@
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:
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
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>
@@ -370,13 +370,63 @@ linux32_sys_eventfd2(struct lwp *l, cons @@ -370,13 +370,63 @@ linux32_sys_eventfd2(struct lwp *l, cons
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}