Sat Jul 29 15:04:29 2023 UTC ()
Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta


(christos)
diff -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/syscalls.master
diff -r1.103 -r1.104 src/sys/compat/linux/arch/alpha/syscalls.master
diff -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/syscalls.master
diff -r1.76 -r1.77 src/sys/compat/linux/arch/arm/syscalls.master
diff -r1.131 -r1.132 src/sys/compat/linux/arch/i386/syscalls.master
diff -r1.102 -r1.103 src/sys/compat/linux/arch/m68k/syscalls.master
diff -r1.75 -r1.76 src/sys/compat/linux/arch/mips/syscalls.master
diff -r1.81 -r1.82 src/sys/compat/linux/arch/powerpc/syscalls.master
diff -r1.67 -r1.68 src/sys/compat/linux/common/linux_file64.c
diff -r1.259 -r1.260 src/sys/compat/linux/common/linux_misc.c

cvs diff -r1.8 -r1.9 src/sys/compat/linux/arch/aarch64/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/aarch64/syscalls.master 2023/07/29 06:47:26 1.8
+++ src/sys/compat/linux/arch/aarch64/syscalls.master 2023/07/29 15:04:28 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.8 2023/07/29 06:47:26 rin Exp $ 1 $NetBSD: syscalls.master,v 1.9 2023/07/29 15:04:28 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; Derived from sys/compat/linux/arch/*/syscalls.master 5; Derived from sys/compat/linux/arch/*/syscalls.master
6; and from Linux include/uapi/asm-generic/unistd.h 6; and from Linux include/uapi/asm-generic/unistd.h
7 7
8; NetBSD aarch64 COMPAT_LINUX system call name/number "master" file. 8; NetBSD aarch64 COMPAT_LINUX system call name/number "master" file.
9; (See syscalls.conf to see what it is processed into.) 9; (See syscalls.conf to see what it is processed into.)
10; 10;
11; Fields: number type [type-dependent ...] 11; Fields: number type [type-dependent ...]
12; number system call number, must be in order 12; number system call number, must be in order
13; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 13; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
14; the compatibility options defined in syscalls.conf. 14; the compatibility options defined in syscalls.conf.
@@ -423,27 +423,28 @@ @@ -423,27 +423,28 @@
423 int flags, struct osockaddr *to, int tolen); } 423 int flags, struct osockaddr *to, int tolen); }
424207 STD { ssize_t|linux_sys||recvfrom(int s, void *buf, \ 424207 STD { ssize_t|linux_sys||recvfrom(int s, void *buf, \
425 size_t len, int flags, struct osockaddr *from, \ 425 size_t len, int flags, struct osockaddr *from, \
426 unsigned int *fromlenaddr); } 426 unsigned int *fromlenaddr); }
427208 STD { int|linux_sys||setsockopt(int s, int level, \ 427208 STD { int|linux_sys||setsockopt(int s, int level, \
428 int optname, void *optval, int optlen); } 428 int optname, void *optval, int optlen); }
429209 STD { int|linux_sys||getsockopt(int s, int level, \ 429209 STD { int|linux_sys||getsockopt(int s, int level, \
430 int optname, void *optval, int *optlen); } 430 int optname, void *optval, int *optlen); }
431210 NOARGS { int|sys||shutdown(int s, int how); } 431210 NOARGS { int|sys||shutdown(int s, int how); }
432211 STD { int|linux_sys||sendmsg(int s, \ 432211 STD { int|linux_sys||sendmsg(int s, \
433 const struct linux_msghdr *msg, int flags); } 433 const struct linux_msghdr *msg, int flags); }
434212 STD { ssize_t|linux_sys||recvmsg(int s, \ 434212 STD { ssize_t|linux_sys||recvmsg(int s, \
435 struct linux_msghdr *msg, int flags); } 435 struct linux_msghdr *msg, int flags); }
436213 UNIMPL readahead 436213 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 437 size_t count); }
437214 STD { int|linux_sys||brk(char *nsize); } 438214 STD { int|linux_sys||brk(char *nsize); }
438215 NOARGS { int|sys||munmap(void *addr, size_t len); } 439215 NOARGS { int|sys||munmap(void *addr, size_t len); }
439216 STD { void *|linux_sys||mremap(void *old_address, \ 440216 STD { void *|linux_sys||mremap(void *old_address, \
440 size_t old_size, size_t new_size, u_long flags); } 441 size_t old_size, size_t new_size, u_long flags); }
441217 UNIMPL add_key 442217 UNIMPL add_key
442218 UNIMPL request_key 443218 UNIMPL request_key
443219 UNIMPL keyctl 444219 UNIMPL keyctl
444220 STD { int|linux_sys||clone(int flags, void *stack, \ 445220 STD { int|linux_sys||clone(int flags, void *stack, \
445 void *parent_tidptr, void *child_tidptr, void *tls); } 446 void *parent_tidptr, void *child_tidptr, void *tls); }
446221 NOARGS { int|sys||execve(const char *path, char **argp, \ 447221 NOARGS { int|sys||execve(const char *path, char **argp, \
447 char **envp); } 448 char **envp); }
448222 NOARGS { linux_off_t|linux_sys||mmap(unsigned long addr, \ 449222 NOARGS { linux_off_t|linux_sys||mmap(unsigned long addr, \
449 size_t len, int prot, int flags, int fd, \ 450 size_t len, int prot, int flags, int fd, \
@@ -665,24 +666,25 @@ @@ -665,24 +666,25 @@
665423 UNIMPL 666423 UNIMPL
666424 UNIMPL pidfd_send_signal 667424 UNIMPL pidfd_send_signal
667425 UNIMPL io_uring_setup 668425 UNIMPL io_uring_setup
668426 UNIMPL io_uring_enter 669426 UNIMPL io_uring_enter
669427 UNIMPL io_uring_register 670427 UNIMPL io_uring_register
670428 UNIMPL open_tree 671428 UNIMPL open_tree
671429 UNIMPL move_mount 672429 UNIMPL move_mount
672430 UNIMPL fsopen 673430 UNIMPL fsopen
673431 UNIMPL fsconfig 674431 UNIMPL fsconfig
674432 UNIMPL fsmount 675432 UNIMPL fsmount
675433 UNIMPL fspick 676433 UNIMPL fspick
676434 UNIMPL pidfd_open 677434 UNIMPL pidfd_open
677435 UNIMPL clone3 678435 UNIMPL clone3
678436 UNIMPL 679436 STD { int|linux_sys||close_range(unsigned int first, \
 680 unsigned int last, unsigned int flags); }
679437 UNIMPL openat2 681437 UNIMPL openat2
680438 UNIMPL pidfd_getfd 682438 UNIMPL pidfd_getfd
681439 UNIMPL faccessat2 683439 UNIMPL faccessat2
682 684
683; we want a "nosys" syscall, we'll just add an extra entry for it. 685; we want a "nosys" syscall, we'll just add an extra entry for it.
684440 STD { int|linux_sys||nosys(void); } 686440 STD { int|linux_sys||nosys(void); }
685441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 687441 STD { int|linux_sys||epoll_pwait2(int epfd, \
686 struct linux_epoll_event *events, int maxevents, \ 688 struct linux_epoll_event *events, int maxevents, \
687 const struct linux_timespec *timeout, \ 689 const struct linux_timespec *timeout, \
688 const linux_sigset_t *sigmask); } 690 const linux_sigset_t *sigmask); }

cvs diff -r1.103 -r1.104 src/sys/compat/linux/arch/alpha/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/alpha/syscalls.master 2023/07/28 19:01:11 1.103
+++ src/sys/compat/linux/arch/alpha/syscalls.master 2023/07/29 15:04:28 1.104
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.103 2023/07/28 19:01:11 christos Exp $ 1 $NetBSD: syscalls.master,v 1.104 2023/07/29 15:04:28 christos Exp $
2; 2;
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; NetBSD alpha COMPAT_LINUX system call name/number "master" file. 5; NetBSD alpha COMPAT_LINUX system call name/number "master" file.
6; (See syscalls.conf to see what it is processed into.) 6; (See syscalls.conf to see what it is processed into.)
7; 7;
8; Fields: number type [type-dependent ...] 8; Fields: number type [type-dependent ...]
9; number system call number, must be in order 9; number system call number, must be in order
10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11; the compatibility options defined in syscalls.conf. 11; the compatibility options defined in syscalls.conf.
12; 12;
13; types: 13; types:
14; STD always included 14; STD always included
@@ -604,27 +604,28 @@ @@ -604,27 +604,28 @@
604367 NOARGS { int|sys||__getcwd(char *bufp, size_t length); } 604367 NOARGS { int|sys||__getcwd(char *bufp, size_t length); }
605368 UNIMPL capget 605368 UNIMPL capget
606369 UNIMPL capset 606369 UNIMPL capset
607370 UNIMPL sendfile 607370 UNIMPL sendfile
608371 UNIMPL setresgid 608371 UNIMPL setresgid
609372 UNIMPL getresgid 609372 UNIMPL getresgid
610373 UNIMPL sys_dipc 610373 UNIMPL sys_dipc
611374 UNIMPL pivot_root 611374 UNIMPL pivot_root
612375 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 612375 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
613376 UNIMPL pciconfig_iobase 613376 UNIMPL pciconfig_iobase
614377 STD { int|linux_sys||getdents64(int fd, \ 614377 STD { int|linux_sys||getdents64(int fd, \
615 struct linux_dirent64 *dent, unsigned int count); } 615 struct linux_dirent64 *dent, unsigned int count); }
616378 NOARGS { pid_t|linux_sys||gettid(void); } 616378 NOARGS { pid_t|linux_sys||gettid(void); }
617379 UNIMPL readahead 617379 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 618 size_t count); }
618380 UNIMPL /* unused */ 619380 UNIMPL /* unused */
619381 STD { int|linux_sys||tkill(int tid, int sig); } 620381 STD { int|linux_sys||tkill(int tid, int sig); }
620382 STD { int|linux_sys||setxattr(char *path, char *name, \ 621382 STD { int|linux_sys||setxattr(char *path, char *name, \
621 void *value, size_t size, int flags); } 622 void *value, size_t size, int flags); }
622383 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 623383 STD { int|linux_sys||lsetxattr(char *path, char *name, \
623 void *value, size_t size, int flags); } 624 void *value, size_t size, int flags); }
624384 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 625384 STD { int|linux_sys||fsetxattr(int fd, char *name, \
625 void *value, size_t size, int flags); } 626 void *value, size_t size, int flags); }
626385 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 627385 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
627 void *value, size_t size); } 628 void *value, size_t size); }
628386 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 629386 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
629 void *value, size_t size); } 630 void *value, size_t size); }
630387 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 631387 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
@@ -820,46 +821,49 @@ @@ -820,46 +821,49 @@
820509 UNIMPL sched_getattr 821509 UNIMPL sched_getattr
821510 UNIMPL renameat2 822510 UNIMPL renameat2
822511 UNIMPL 823511 UNIMPL
823512 UNIMPL 824512 UNIMPL
824513 UNIMPL 825513 UNIMPL
825514 UNIMPL 826514 UNIMPL
826515 UNIMPL 827515 UNIMPL
827516 UNIMPL 828516 UNIMPL
828517 UNIMPL 829517 UNIMPL
829518 UNIMPL 830518 UNIMPL
830519 UNIMPL 831519 UNIMPL
831520 UNIMPL 832520 UNIMPL
832521 UNIMPL 833521 UNIMPL
833522 UNIMPL 834522 STD { int|linux_sys||statx(int fd, const char *path, \
 835 int flag, unsigned int mask, \
 836 struct linux_statx *sp); }
834523 UNIMPL 837523 UNIMPL
835524 UNIMPL 838524 UNIMPL
836525 UNIMPL 839525 UNIMPL
837526 UNIMPL 840526 UNIMPL
838527 UNIMPL 841527 UNIMPL
839528 UNIMPL 842528 UNIMPL
840529 UNIMPL 843529 UNIMPL
841530 UNIMPL 844530 UNIMPL
842531 UNIMPL 845531 UNIMPL
843532 UNIMPL 846532 UNIMPL
844533 UNIMPL 847533 UNIMPL
845534 UNIMPL 848534 UNIMPL
846535 UNIMPL 849535 UNIMPL
847536 UNIMPL 850536 UNIMPL
848537 UNIMPL 851537 UNIMPL
849538 UNIMPL 852538 UNIMPL
850539 UNIMPL 853539 UNIMPL
851540 UNIMPL 854540 UNIMPL
852541 UNIMPL 855541 UNIMPL
853542 UNIMPL 856542 UNIMPL
854543 UNIMPL 857543 UNIMPL
855544 UNIMPL 858544 UNIMPL
856545 UNIMPL 859545 UNIMPL
857546 UNIMPL 860546 STD { int|linux_sys||close_range(unsigned int first, \
 861 unsigned int last, unsigned int flags); }
858547 UNIMPL 862547 UNIMPL
859548 UNIMPL 863548 UNIMPL
860549 UNIMPL 864549 UNIMPL
861550 UNIMPL 865550 UNIMPL
862551 STD { int|linux_sys||epoll_pwait2(int epfd, \ 866551 STD { int|linux_sys||epoll_pwait2(int epfd, \
863 struct linux_epoll_event *events, int maxevents, \ 867 struct linux_epoll_event *events, int maxevents, \
864 const struct linux_timespec *timeout, \ 868 const struct linux_timespec *timeout, \
865 const linux_sigset_t *sigmask); } 869 const linux_sigset_t *sigmask); }

cvs diff -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/amd64/syscalls.master 2023/07/28 18:19:00 1.69
+++ src/sys/compat/linux/arch/amd64/syscalls.master 2023/07/29 15:04:28 1.70
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.69 2023/07/28 18:19:00 christos Exp $ 1 $NetBSD: syscalls.master,v 1.70 2023/07/29 15:04:28 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; NetBSD amd64 COMPAT_LINUX system call name/number "master" file. 5; NetBSD amd64 COMPAT_LINUX system call name/number "master" file.
6; (See syscalls.conf to see what it is processed into.) 6; (See syscalls.conf to see what it is processed into.)
7; 7;
8; Fields: number type [type-dependent ...] 8; Fields: number type [type-dependent ...]
9; number system call number, must be in order 9; number system call number, must be in order
10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11; the compatibility options defined in syscalls.conf. 11; the compatibility options defined in syscalls.conf.
12; 12;
13; types: 13; types:
14; STD always included 14; STD always included
@@ -364,27 +364,28 @@ @@ -364,27 +364,28 @@
364174 UNIMPL create_module 364174 UNIMPL create_module
365175 UNIMPL init_module 365175 UNIMPL init_module
366176 UNIMPL delete_module 366176 UNIMPL delete_module
367177 UNIMPL get_kernel_syms 367177 UNIMPL get_kernel_syms
368178 UNIMPL query_module 368178 UNIMPL query_module
369179 UNIMPL quotactl 369179 UNIMPL quotactl
370180 UNIMPL nfsservctl 370180 UNIMPL nfsservctl
371181 UNIMPL getpmsg 371181 UNIMPL getpmsg
372182 UNIMPL putpmsg 372182 UNIMPL putpmsg
373183 UNIMPL afs_syscall 373183 UNIMPL afs_syscall
374184 UNIMPL tuxcall 374184 UNIMPL tuxcall
375185 UNIMPL security 375185 UNIMPL security
376186 STD { pid_t|linux_sys||gettid(void); } 376186 STD { pid_t|linux_sys||gettid(void); }
377187 UNIMPL readahead 377187 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 378 size_t count); }
378188 STD { int|linux_sys||setxattr(char *path, char *name, \ 379188 STD { int|linux_sys||setxattr(char *path, char *name, \
379 void *value, size_t size, int flags); } 380 void *value, size_t size, int flags); }
380189 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 381189 STD { int|linux_sys||lsetxattr(char *path, char *name, \
381 void *value, size_t size, int flags); } 382 void *value, size_t size, int flags); }
382190 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 383190 STD { int|linux_sys||fsetxattr(int fd, char *name, \
383 void *value, size_t size, int flags); } 384 void *value, size_t size, int flags); }
384191 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 385191 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
385 void *value, size_t size); } 386 void *value, size_t size); }
386192 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 387192 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
387 void *value, size_t size); } 388 void *value, size_t size); }
388193 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 389193 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
389 void *value, size_t size); } 390 void *value, size_t size); }
390194 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 391194 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
@@ -583,27 +584,29 @@ @@ -583,27 +584,29 @@
583 unsigned int flags); } 584 unsigned int flags); }
584320 UNIMPL kexec_file_load 585320 UNIMPL kexec_file_load
585321 UNIMPL bpf 586321 UNIMPL bpf
586322 UNIMPL execveat 587322 UNIMPL execveat
587323 UNIMPL userfaultfd 588323 UNIMPL userfaultfd
588324 UNIMPL membarrier 589324 UNIMPL membarrier
589325 UNIMPL mlock2 590325 UNIMPL mlock2
590326 UNIMPL copy_file_range 591326 UNIMPL copy_file_range
591327 UNIMPL preadv2 592327 UNIMPL preadv2
592328 UNIMPL pwritev2 593328 UNIMPL pwritev2
593329 UNIMPL pkey_mprotect 594329 UNIMPL pkey_mprotect
594330 UNIMPL pkey_alloc 595330 UNIMPL pkey_alloc
595331 UNIMPL pkey_free 596331 UNIMPL pkey_free
596332 UNIMPL statx 597332 STD { int|linux_sys||statx(int fd, const char *path, \
 598 int flag, unsigned int mask, \
 599 struct linux_statx *sp); }
597333 UNIMPL io_pgetevents 600333 UNIMPL io_pgetevents
598334 UNIMPL rseq 601334 UNIMPL rseq
599335 UNIMPL 602335 UNIMPL
600336 UNIMPL 603336 UNIMPL
601337 UNIMPL 604337 UNIMPL
602338 UNIMPL 605338 UNIMPL
603339 UNIMPL 606339 UNIMPL
604340 UNIMPL 607340 UNIMPL
605341 UNIMPL 608341 UNIMPL
606342 UNIMPL 609342 UNIMPL
607343 UNIMPL 610343 UNIMPL
608344 UNIMPL 611344 UNIMPL
609345 UNIMPL 612345 UNIMPL
@@ -687,27 +690,28 @@ @@ -687,27 +690,28 @@
687423 UNIMPL 690423 UNIMPL
688424 UNIMPL pidfd_send_signal 691424 UNIMPL pidfd_send_signal
689425 UNIMPL io_uring_setup 692425 UNIMPL io_uring_setup
690426 UNIMPL io_uring_enter 693426 UNIMPL io_uring_enter
691427 UNIMPL io_uring_register 694427 UNIMPL io_uring_register
692428 UNIMPL open_tree 695428 UNIMPL open_tree
693429 UNIMPL move_mount 696429 UNIMPL move_mount
694430 UNIMPL fsopen 697430 UNIMPL fsopen
695431 UNIMPL fsconfig 698431 UNIMPL fsconfig
696432 UNIMPL fsmount 699432 UNIMPL fsmount
697433 UNIMPL fspick 700433 UNIMPL fspick
698434 UNIMPL pidfd_open 701434 UNIMPL pidfd_open
699435 UNIMPL clone3 702435 UNIMPL clone3
700436 UNIMPL close_range 703436 STD { int|linux_sys||close_range(unsigned int first, \
 704 unsigned int last, unsigned int flags); }
701437 UNIMPL openat2 705437 UNIMPL openat2
702438 UNIMPL pidfd_getfd 706438 UNIMPL pidfd_getfd
703439 UNIMPL faccessat2 707439 UNIMPL faccessat2
704440 UNIMPL process_madvise 708440 UNIMPL process_madvise
705441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 709441 STD { int|linux_sys||epoll_pwait2(int epfd, \
706 struct linux_epoll_event *events, int maxevents, \ 710 struct linux_epoll_event *events, int maxevents, \
707 const struct linux_timespec *timeout, \ 711 const struct linux_timespec *timeout, \
708 const linux_sigset_t *sigmask); } 712 const linux_sigset_t *sigmask); }
709442 UNIMPL mount_setattr 713442 UNIMPL mount_setattr
710443 UNIMPL quotactl_fd 714443 UNIMPL quotactl_fd
711444 UNIMPL landlock_create_ruleset 715444 UNIMPL landlock_create_ruleset
712445 UNIMPL landlock_add_rule 716445 UNIMPL landlock_add_rule
713446 UNIMPL landlock_restrict_self 717446 UNIMPL landlock_restrict_self

cvs diff -r1.76 -r1.77 src/sys/compat/linux/arch/arm/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/arm/syscalls.master 2023/07/28 19:01:11 1.76
+++ src/sys/compat/linux/arch/arm/syscalls.master 2023/07/29 15:04:28 1.77
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.76 2023/07/28 19:01:11 christos Exp $ 1 $NetBSD: syscalls.master,v 1.77 2023/07/29 15:04:28 christos Exp $
2 2
3; Derived from sys/compat/linux/arch/*/syscalls.master 3; Derived from sys/compat/linux/arch/*/syscalls.master
4; and from Linux 2.4.12 arch/arm/kernel/calls.S 4; and from Linux 2.4.12 arch/arm/kernel/calls.S
5 5
6; NetBSD/arm COMPAT_LINUX system call name/number "master" file. 6; NetBSD/arm COMPAT_LINUX system call name/number "master" file.
7; (See syscalls.conf to see what it is processed into.) 7; (See syscalls.conf to see what it is processed into.)
8; 8;
9; Fields: number type [type-dependent ...] 9; Fields: number type [type-dependent ...]
10; number system call number, must be in order 10; number system call number, must be in order
11; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 11; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
12; the compatibility options defined in syscalls.conf. 12; the compatibility options defined in syscalls.conf.
13; 13;
14; types: 14; types:
@@ -376,27 +376,28 @@ @@ -376,27 +376,28 @@
376213 NOARGS setuid32 { int|sys||setuid(uid_t uid); } 376213 NOARGS setuid32 { int|sys||setuid(uid_t uid); }
377214 NOARGS setgid32 { int|sys||setgid(gid_t gid); } 377214 NOARGS setgid32 { int|sys||setgid(gid_t gid); }
378215 NOARGS setfsuid32 { int|linux_sys||setfsuid(uid_t uid); } 378215 NOARGS setfsuid32 { int|linux_sys||setfsuid(uid_t uid); }
379216 NOARGS setfsgid32 { int|linux_sys||setfsgid(gid_t gid); } 379216 NOARGS setfsgid32 { int|linux_sys||setfsgid(gid_t gid); }
380217 STD { int|linux_sys||getdents64(int fd, \ 380217 STD { int|linux_sys||getdents64(int fd, \
381 struct linux_dirent64 *dent, unsigned int count); } 381 struct linux_dirent64 *dent, unsigned int count); }
382218 UNIMPL pivot_root 382218 UNIMPL pivot_root
383219 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 383219 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
384220 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 384220 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
385221 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); } 385221 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); }
386222 UNIMPL /* for tux */ 386222 UNIMPL /* for tux */
387223 UNIMPL /* unused */ 387223 UNIMPL /* unused */
388224 NOARGS { pid_t|linux_sys||gettid(void); } 388224 NOARGS { pid_t|linux_sys||gettid(void); }
389225 UNIMPL readahead 389225 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 390 size_t count); }
390226 STD { int|linux_sys||setxattr(char *path, char *name, \ 391226 STD { int|linux_sys||setxattr(char *path, char *name, \
391 void *value, size_t size, int flags); } 392 void *value, size_t size, int flags); }
392227 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 393227 STD { int|linux_sys||lsetxattr(char *path, char *name, \
393 void *value, size_t size, int flags); } 394 void *value, size_t size, int flags); }
394228 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 395228 STD { int|linux_sys||fsetxattr(int fd, char *name, \
395 void *value, size_t size, int flags); } 396 void *value, size_t size, int flags); }
396229 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 397229 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
397 void *value, size_t size); } 398 void *value, size_t size); }
398230 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 399230 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
399 void *value, size_t size); } 400 void *value, size_t size); }
400231 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 401231 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
401 void *value, size_t size); } 402 void *value, size_t size); }
402232 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 403232 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
@@ -634,27 +635,29 @@ @@ -634,27 +635,29 @@
634385 STD { int|linux_sys||breakpoint(void); } 635385 STD { int|linux_sys||breakpoint(void); }
635386 STD { int|linux_sys||cacheflush(uintptr_t from, \ 636386 STD { int|linux_sys||cacheflush(uintptr_t from, \
636 intptr_t to, int flags); } 637 intptr_t to, int flags); }
637387 UNIMPL usr26 638387 UNIMPL usr26
638388 UNIMPL usr32 639388 UNIMPL usr32
639389 STD { int|linux_sys||set_tls(void *tls); } 640389 STD { int|linux_sys||set_tls(void *tls); }
640390 UNIMPL 641390 UNIMPL
641391 UNIMPL 642391 UNIMPL
642392 UNIMPL 643392 UNIMPL
643393 UNIMPL 644393 UNIMPL
644394 UNIMPL 645394 UNIMPL
645395 UNIMPL 646395 UNIMPL
646396 UNIMPL 647396 UNIMPL
647397 UNIMPL 648397 STD { int|linux_sys||statx(int fd, const char *path, \
 649 int flag, unsigned int mask, \
 650 struct linux_statx *sp); }
648398 UNIMPL 651398 UNIMPL
649399 UNIMPL 652399 UNIMPL
650400 UNIMPL 653400 UNIMPL
651401 UNIMPL 654401 UNIMPL
652402 UNIMPL 655402 UNIMPL
653403 UNIMPL 656403 UNIMPL
654404 UNIMPL 657404 UNIMPL
655405 UNIMPL 658405 UNIMPL
656406 UNIMPL 659406 UNIMPL
657407 UNIMPL 660407 UNIMPL
658408 UNIMPL 661408 UNIMPL
659409 UNIMPL 662409 UNIMPL
660410 UNIMPL 663410 UNIMPL
@@ -673,22 +676,23 @@ @@ -673,22 +676,23 @@
673423 UNIMPL 676423 UNIMPL
674424 UNIMPL 677424 UNIMPL
675425 UNIMPL 678425 UNIMPL
676426 UNIMPL 679426 UNIMPL
677427 UNIMPL 680427 UNIMPL
678428 UNIMPL 681428 UNIMPL
679429 UNIMPL 682429 UNIMPL
680430 UNIMPL 683430 UNIMPL
681431 UNIMPL 684431 UNIMPL
682432 UNIMPL 685432 UNIMPL
683433 UNIMPL 686433 UNIMPL
684434 UNIMPL 687434 UNIMPL
685435 UNIMPL 688435 UNIMPL
686436 UNIMPL 689436 STD { int|linux_sys||close_range(unsigned int first, \
 690 unsigned int last, unsigned int flags); }
687437 UNIMPL 691437 UNIMPL
688438 UNIMPL 692438 UNIMPL
689439 UNIMPL 693439 UNIMPL
690440 UNIMPL 694440 UNIMPL
691441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 695441 STD { int|linux_sys||epoll_pwait2(int epfd, \
692 struct linux_epoll_event *events, int maxevents, \ 696 struct linux_epoll_event *events, int maxevents, \
693 const struct linux_timespec *timeout, \ 697 const struct linux_timespec *timeout, \
694 const linux_sigset_t *sigmask); } 698 const linux_sigset_t *sigmask); }

cvs diff -r1.131 -r1.132 src/sys/compat/linux/arch/i386/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/i386/syscalls.master 2023/07/28 19:01:11 1.131
+++ src/sys/compat/linux/arch/i386/syscalls.master 2023/07/29 15:04:28 1.132
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.131 2023/07/28 19:01:11 christos Exp $ 1 $NetBSD: syscalls.master,v 1.132 2023/07/29 15:04:28 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; NetBSD i386 COMPAT_LINUX system call name/number "master" file. 5; NetBSD i386 COMPAT_LINUX system call name/number "master" file.
6; (See syscalls.conf to see what it is processed into.) 6; (See syscalls.conf to see what it is processed into.)
7; 7;
8; Fields: number type [type-dependent ...] 8; Fields: number type [type-dependent ...]
9; number system call number, must be in order 9; number system call number, must be in order
10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11; the compatibility options defined in syscalls.conf. 11; the compatibility options defined in syscalls.conf.
12; 12;
13; types: 13; types:
14; STD always included 14; STD always included
@@ -373,27 +373,28 @@ @@ -373,27 +373,28 @@
373213 NOARGS { int|sys||setuid(uid_t uid); } 373213 NOARGS { int|sys||setuid(uid_t uid); }
374214 NOARGS { int|sys||setgid(gid_t gid); } 374214 NOARGS { int|sys||setgid(gid_t gid); }
375215 STD { int|linux_sys||setfsuid(uid_t uid); } 375215 STD { int|linux_sys||setfsuid(uid_t uid); }
376216 STD { int|linux_sys||setfsgid(gid_t gid); } 376216 STD { int|linux_sys||setfsgid(gid_t gid); }
377217 UNIMPL pivot_root 377217 UNIMPL pivot_root
378218 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 378218 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
379219 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 379219 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
380220 STD { int|linux_sys||getdents64(int fd, \ 380220 STD { int|linux_sys||getdents64(int fd, \
381 struct linux_dirent64 *dent, unsigned int count); } 381 struct linux_dirent64 *dent, unsigned int count); }
382221 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); } 382221 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); }
383222 UNIMPL /* unused */ 383222 UNIMPL /* unused */
384223 UNIMPL /* unused */ 384223 UNIMPL /* unused */
385224 NOARGS { pid_t|linux_sys||gettid(void); } 385224 NOARGS { pid_t|linux_sys||gettid(void); }
386225 UNIMPL readahead 386225 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 387 size_t count); }
387226 STD { int|linux_sys||setxattr(char *path, char *name, \ 388226 STD { int|linux_sys||setxattr(char *path, char *name, \
388 void *value, size_t size, int flags); } 389 void *value, size_t size, int flags); }
389227 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 390227 STD { int|linux_sys||lsetxattr(char *path, char *name, \
390 void *value, size_t size, int flags); } 391 void *value, size_t size, int flags); }
391228 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 392228 STD { int|linux_sys||fsetxattr(int fd, char *name, \
392 void *value, size_t size, int flags); } 393 void *value, size_t size, int flags); }
393229 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 394229 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
394 void *value, size_t size); } 395 void *value, size_t size); }
395230 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 396230 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
396 void *value, size_t size); } 397 void *value, size_t size); }
397231 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 398231 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
398 void *value, size_t size); } 399 void *value, size_t size); }
399232 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 400232 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
@@ -612,27 +613,29 @@ @@ -612,27 +613,29 @@
612384 UNIMPL arch_prctl 613384 UNIMPL arch_prctl
613385 UNIMPL io_pgetevents 614385 UNIMPL io_pgetevents
614386 UNIMPL rseq 615386 UNIMPL rseq
615387 UNIMPL 616387 UNIMPL
616388 UNIMPL 617388 UNIMPL
617389 UNIMPL 618389 UNIMPL
618390 UNIMPL 619390 UNIMPL
619391 UNIMPL 620391 UNIMPL
620392 UNIMPL 621392 UNIMPL
621393 UNIMPL semget 622393 UNIMPL semget
622394 UNIMPL semctl 623394 UNIMPL semctl
623395 UNIMPL shmget 624395 UNIMPL shmget
624396 UNIMPL shmctl 625396 UNIMPL shmctl
625397 UNIMPL shmat 626397 STD { int|linux_sys||statx(int fd, const char *path, \
 627 int flag, unsigned int mask, \
 628 struct linux_statx *sp); }
626398 UNIMPL shmdt 629398 UNIMPL shmdt
627399 UNIMPL msgget 630399 UNIMPL msgget
628400 UNIMPL msgsnd 631400 UNIMPL msgsnd
629401 UNIMPL msgrcv 632401 UNIMPL msgrcv
630402 UNIMPL msgctl 633402 UNIMPL msgctl
631403 UNIMPL clock_gettime64 634403 UNIMPL clock_gettime64
632404 UNIMPL clock_settime64 635404 UNIMPL clock_settime64
633405 UNIMPL clock_adjtime64 636405 UNIMPL clock_adjtime64
634406 UNIMPL clock_getres_time64 637406 UNIMPL clock_getres_time64
635407 UNIMPL clock_nanosleep_time64 638407 UNIMPL clock_nanosleep_time64
636408 UNIMPL timer_gettime64 639408 UNIMPL timer_gettime64
637409 UNIMPL timer_settime64 640409 UNIMPL timer_settime64
638410 UNIMPL timerfd_gettime64 641410 UNIMPL timerfd_gettime64
@@ -651,22 +654,23 @@ @@ -651,22 +654,23 @@
651423 UNIMPL sched_rr_get_interval_time64 654423 UNIMPL sched_rr_get_interval_time64
652424 UNIMPL pidfd_send_signal 655424 UNIMPL pidfd_send_signal
653425 UNIMPL io_uring_setup 656425 UNIMPL io_uring_setup
654426 UNIMPL io_uring_enter 657426 UNIMPL io_uring_enter
655427 UNIMPL io_uring_register 658427 UNIMPL io_uring_register
656428 UNIMPL open_tree 659428 UNIMPL open_tree
657429 UNIMPL move_mount 660429 UNIMPL move_mount
658430 UNIMPL fsopen 661430 UNIMPL fsopen
659431 UNIMPL fsconfig 662431 UNIMPL fsconfig
660432 UNIMPL fsmount 663432 UNIMPL fsmount
661433 UNIMPL fspick 664433 UNIMPL fspick
662434 UNIMPL pidfd_open 665434 UNIMPL pidfd_open
663435 UNIMPL clone3 666435 UNIMPL clone3
664436 UNIMPL close_range 667436 STD { int|linux_sys||close_range(unsigned int first, \
 668 unsigned int last, unsigned int flags); }
665437 UNIMPL openat2 669437 UNIMPL openat2
666438 UNIMPL pidfd_getfd 670438 UNIMPL pidfd_getfd
667439 UNIMPL faccessat2 671439 UNIMPL faccessat2
668440 UNIMPL process_madvise 672440 UNIMPL process_madvise
669441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 673441 STD { int|linux_sys||epoll_pwait2(int epfd, \
670 struct linux_epoll_event *events, int maxevents, \ 674 struct linux_epoll_event *events, int maxevents, \
671 const struct linux_timespec *timeout, \ 675 const struct linux_timespec *timeout, \
672 const linux_sigset_t *sigmask); } 676 const linux_sigset_t *sigmask); }

cvs diff -r1.102 -r1.103 src/sys/compat/linux/arch/m68k/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/m68k/syscalls.master 2023/07/28 19:01:11 1.102
+++ src/sys/compat/linux/arch/m68k/syscalls.master 2023/07/29 15:04:29 1.103
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.102 2023/07/28 19:01:11 christos Exp $ 1 $NetBSD: syscalls.master,v 1.103 2023/07/29 15:04:29 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; NetBSD m68k COMPAT_LINUX system call name/number "master" file. 5; NetBSD m68k COMPAT_LINUX system call name/number "master" file.
6; (See syscalls.conf to see what it is processed into.) 6; (See syscalls.conf to see what it is processed into.)
7; 7;
8; Fields: number type [type-dependent ...] 8; Fields: number type [type-dependent ...]
9; number system call number, must be in order 9; number system call number, must be in order
10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of 10; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11; the compatibility options defined in syscalls.conf. 11; the compatibility options defined in syscalls.conf.
12; 12;
13; types: 13; types:
14; STD always included 14; STD always included
@@ -418,27 +418,28 @@ @@ -418,27 +418,28 @@
418 size_t size); } 418 size_t size); }
419231 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \ 419231 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \
420 size_t size); } 420 size_t size); }
421232 STD { int|linux_sys||removexattr(char *path, char *name); } 421232 STD { int|linux_sys||removexattr(char *path, char *name); }
422233 STD { int|linux_sys||lremovexattr(char *path, char *name); } 422233 STD { int|linux_sys||lremovexattr(char *path, char *name); }
423234 STD { int|linux_sys||fremovexattr(int fd, char *name); } 423234 STD { int|linux_sys||fremovexattr(int fd, char *name); }
424235 STD { int|linux_sys||futex(int *uaddr, int op, int val, \ 424235 STD { int|linux_sys||futex(int *uaddr, int op, int val, \
425 const struct linux_timespec *timeout, int *uaddr2, \ 425 const struct linux_timespec *timeout, int *uaddr2, \
426 int val3); } 426 int val3); }
427236 UNIMPL sendfile64 427236 UNIMPL sendfile64
428237 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 428237 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
429238 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 429238 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
430239 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); } 430239 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); }
431240 UNIMPL readahead 431240 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 432 size_t count); }
432241 UNIMPL io_setup 433241 UNIMPL io_setup
433242 UNIMPL io_destroy 434242 UNIMPL io_destroy
434243 UNIMPL io_getevents 435243 UNIMPL io_getevents
435244 UNIMPL io_submit 436244 UNIMPL io_submit
436245 UNIMPL io_cancel 437245 UNIMPL io_cancel
437246 STD { int|linux_sys||fadvise64(int fd, off_t offset, \ 438246 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
438 size_t len, int advice); } 439 size_t len, int advice); }
439247 UNIMPL exit_group 440247 UNIMPL exit_group
440248 UNIMPL lookup_dcookie 441248 UNIMPL lookup_dcookie
441249 STD { int|linux_sys||epoll_create(int size); } 442249 STD { int|linux_sys||epoll_create(int size); }
442250 STD { int|linux_sys||epoll_ctl(int epfd, int op, int fd, \ 443250 STD { int|linux_sys||epoll_ctl(int epfd, int op, int fd, \
443 struct linux_epoll_event *event); } 444 struct linux_epoll_event *event); }
444251 STD { int|linux_sys||epoll_wait(int epfd, \ 445251 STD { int|linux_sys||epoll_wait(int epfd, \
@@ -621,27 +622,29 @@ @@ -621,27 +622,29 @@
621370 UNIMPL shutdown 622370 UNIMPL shutdown
622371 STD { int|linux_sys||recvmmsg(int s, \ 623371 STD { int|linux_sys||recvmmsg(int s, \
623 struct linux_mmsghdr *msgvec, unsigned int vlen, \ 624 struct linux_mmsghdr *msgvec, unsigned int vlen, \
624 unsigned int flags, struct timespec *timeout); } 625 unsigned int flags, struct timespec *timeout); }
625372 STD { int|linux_sys||sendmmsg(int s, \ 626372 STD { int|linux_sys||sendmmsg(int s, \
626 struct linux_mmsghdr *msgvec, unsigned int vlen, \ 627 struct linux_mmsghdr *msgvec, unsigned int vlen, \
627 unsigned int flags); } 628 unsigned int flags); }
628373 UNIMPL userfaultfd 629373 UNIMPL userfaultfd
629374 UNIMPL membarrier 630374 UNIMPL membarrier
630375 UNIMPL mlock2 631375 UNIMPL mlock2
631376 UNIMPL copy_file_range 632376 UNIMPL copy_file_range
632377 UNIMPL preadv2 633377 UNIMPL preadv2
633378 UNIMPL pwritev2 634378 UNIMPL pwritev2
634379 UNIMPL 635379 STD { int|linux_sys||statx(int fd, const char *path, \
 636 int flag, unsigned int mask, \
 637 struct linux_statx *sp); }
635380 UNIMPL 638380 UNIMPL
636381 UNIMPL 639381 UNIMPL
637382 UNIMPL 640382 UNIMPL
638383 UNIMPL 641383 UNIMPL
639384 UNIMPL 642384 UNIMPL
640385 UNIMPL 643385 UNIMPL
641386 UNIMPL 644386 UNIMPL
642387 UNIMPL 645387 UNIMPL
643388 UNIMPL 646388 UNIMPL
644389 UNIMPL 647389 UNIMPL
645390 UNIMPL 648390 UNIMPL
646391 UNIMPL 649391 UNIMPL
647392 UNIMPL 650392 UNIMPL
@@ -678,22 +681,23 @@ @@ -678,22 +681,23 @@
678423 UNIMPL 681423 UNIMPL
679424 UNIMPL 682424 UNIMPL
680425 UNIMPL 683425 UNIMPL
681426 UNIMPL 684426 UNIMPL
682427 UNIMPL 685427 UNIMPL
683428 UNIMPL 686428 UNIMPL
684429 UNIMPL 687429 UNIMPL
685430 UNIMPL 688430 UNIMPL
686431 UNIMPL 689431 UNIMPL
687432 UNIMPL 690432 UNIMPL
688433 UNIMPL 691433 UNIMPL
689434 UNIMPL 692434 UNIMPL
690435 UNIMPL 693435 UNIMPL
691436 UNIMPL 694436 STD { int|linux_sys||close_range(unsigned int first, \
 695 unsigned int last, unsigned int flags); }
692437 UNIMPL 696437 UNIMPL
693438 UNIMPL 697438 UNIMPL
694439 UNIMPL 698439 UNIMPL
695440 UNIMPL 699440 UNIMPL
696441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 700441 STD { int|linux_sys||epoll_pwait2(int epfd, \
697 struct linux_epoll_event *events, int maxevents, \ 701 struct linux_epoll_event *events, int maxevents, \
698 const struct linux_timespec *timeout, \ 702 const struct linux_timespec *timeout, \
699 const linux_sigset_t *sigmask); } 703 const linux_sigset_t *sigmask); }

cvs diff -r1.75 -r1.76 src/sys/compat/linux/arch/mips/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/mips/syscalls.master 2023/07/28 19:01:11 1.75
+++ src/sys/compat/linux/arch/mips/syscalls.master 2023/07/29 15:04:29 1.76
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.75 2023/07/28 19:01:11 christos Exp $  1 $NetBSD: syscalls.master,v 1.76 2023/07/29 15:04:29 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; Derived from NetBSD's sys/compat/linux/arch/powerpc/syscalls.master 5; Derived from NetBSD's sys/compat/linux/arch/powerpc/syscalls.master
6; from Linux's arch/mips/kernel/syscalls.h 6; from Linux's arch/mips/kernel/syscalls.h
7 7
8; NetBSD mips COMPAT_LINUX system call name/number "master" file. 8; NetBSD mips COMPAT_LINUX system call name/number "master" file.
9; (See syscalls.conf to see what it is processed into.) 9; (See syscalls.conf to see what it is processed into.)
10; 10;
11; Expect problems with 11; Expect problems with
12; 48 signal: undefined in Linux??? 12; 48 signal: undefined in Linux???
13; 86 uselib: needs a.out 13; 86 uselib: needs a.out
14; 14;
@@ -379,27 +379,28 @@ @@ -379,27 +379,28 @@
379214 STD { int|linux_sys||lstat64(const char *path, \ 379214 STD { int|linux_sys||lstat64(const char *path, \
380 struct linux_stat64 *sp); } 380 struct linux_stat64 *sp); }
381215 STD { int|linux_sys||fstat64(int fd, \ 381215 STD { int|linux_sys||fstat64(int fd, \
382 struct linux_stat64 *sp); } 382 struct linux_stat64 *sp); }
383216 UNIMPL pivot_root 383216 UNIMPL pivot_root
384217 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 384217 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
385218 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 385218 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
386219 STD { int|linux_sys||getdents64(int fd, \ 386219 STD { int|linux_sys||getdents64(int fd, \
387 struct linux_dirent64 *dent, unsigned int count); } 387 struct linux_dirent64 *dent, unsigned int count); }
388220 STD { int|linux_sys||fcntl64(int fd, \ 388220 STD { int|linux_sys||fcntl64(int fd, \
389 int cmd, void *arg); } 389 int cmd, void *arg); }
390221 UNIMPL /* reserved */ 390221 UNIMPL /* reserved */
391222 NOARGS { pid_t|linux_sys||gettid(void); } 391222 NOARGS { pid_t|linux_sys||gettid(void); }
392223 UNIMPL readahead 392223 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 393 size_t count); }
393224 STD { int|linux_sys||setxattr(char *path, char *name, \ 394224 STD { int|linux_sys||setxattr(char *path, char *name, \
394 void *value, size_t size, int flags); } 395 void *value, size_t size, int flags); }
395225 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 396225 STD { int|linux_sys||lsetxattr(char *path, char *name, \
396 void *value, size_t size, int flags); } 397 void *value, size_t size, int flags); }
397226 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 398226 STD { int|linux_sys||fsetxattr(int fd, char *name, \
398 void *value, size_t size, int flags); } 399 void *value, size_t size, int flags); }
399227 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 400227 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
400 void *value, size_t size); } 401 void *value, size_t size); }
401228 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 402228 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
402 void *value, size_t size); } 403 void *value, size_t size); }
403229 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 404229 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
404 void *value, size_t size); } 405 void *value, size_t size); }
405230 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 406230 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
@@ -582,41 +583,44 @@ @@ -582,41 +583,44 @@
582342 UNIMPL clock_adjtime 583342 UNIMPL clock_adjtime
583343 UNIMPL syncfs 584343 UNIMPL syncfs
584344 STD { int|linux_sys||sendmmsg(int s, \ 585344 STD { int|linux_sys||sendmmsg(int s, \
585 struct linux_mmsghdr *msgvec, unsigned int vlen, \ 586 struct linux_mmsghdr *msgvec, unsigned int vlen, \
586 unsigned int flags); } 587 unsigned int flags); }
587345 UNIMPL setns 588345 UNIMPL setns
588346 UNIMPL process_vm_readv 589346 UNIMPL process_vm_readv
589347 UNIMPL process_vm_writev 590347 UNIMPL process_vm_writev
590348 UNIMPL kcmp 591348 UNIMPL kcmp
591349 UNIMPL finit_module 592349 UNIMPL finit_module
592350 UNIMPL sched_setattr 593350 UNIMPL sched_setattr
593351 UNIMPL sched_getattr 594351 UNIMPL sched_getattr
594352 UNIMPL renameat2 595352 UNIMPL renameat2
595353 UNIMPL seccomp 596353 NOARGS { ssize_t|sys||getrandom(void *buf, size_t buflen, \
596354 NOARGS { ssize_t|sys||getrandom(void *buf, size_t buflen, \ 
597 unsigned int flags); } 597 unsigned int flags); }
598355 UNIMPL memfd_create 598354 STD { int|linux_sys||memfd_create(const char *name, \
599356 UNIMPL bpf 599 unsigned int flags); }
600357 UNIMPL execveat 600355 UNIMPL bpf
601358 UNIMPL userfaultfd 601356 UNIMPL execveat
602359 UNIMPL membarrier 602357 UNIMPL userfaultfd
603360 UNIMPL mlock2 603358 UNIMPL membarrier
604361 UNIMPL copy_file_range 604369 UNIMPL mlock2
605362 UNIMPL preadv2 605360 UNIMPL copy_file_range
606363 UNIMPL pwritev2 606361 UNIMPL preadv2
607364 UNIMPL pkey_mprotect 607362 UNIMPL pwritev2
608365 UNIMPL pkey_alloc 608363 UNIMPL pkey_mprotect
609366 UNIMPL pkey_free 609364 UNIMPL pkey_alloc
 610365 UNIMPL pkey_free
 611366 STD { int|linux_sys||statx(int fd, const char *path, \
 612 int flag, unsigned int mask, \
 613 struct linux_statx *sp); }
610367 UNIMPL 614367 UNIMPL
611368 UNIMPL 615368 UNIMPL
612369 UNIMPL 616369 UNIMPL
613370 UNIMPL 617370 UNIMPL
614371 UNIMPL 618371 UNIMPL
615372 UNIMPL 619372 UNIMPL
616373 UNIMPL 620373 UNIMPL
617374 UNIMPL 621374 UNIMPL
618375 UNIMPL 622375 UNIMPL
619376 UNIMPL 623376 UNIMPL
620377 UNIMPL 624377 UNIMPL
621378 UNIMPL 625378 UNIMPL
622379 UNIMPL 626379 UNIMPL
@@ -666,22 +670,23 @@ @@ -666,22 +670,23 @@
666423 UNIMPL 670423 UNIMPL
667424 UNIMPL 671424 UNIMPL
668425 UNIMPL 672425 UNIMPL
669426 UNIMPL 673426 UNIMPL
670427 UNIMPL 674427 UNIMPL
671428 UNIMPL 675428 UNIMPL
672429 UNIMPL 676429 UNIMPL
673430 UNIMPL 677430 UNIMPL
674431 UNIMPL 678431 UNIMPL
675432 UNIMPL 679432 UNIMPL
676433 UNIMPL 680433 UNIMPL
677434 UNIMPL 681434 UNIMPL
678435 UNIMPL 682435 UNIMPL
679436 UNIMPL 683436 STD { int|linux_sys||close_range(unsigned int first, \
 684 unsigned int last, unsigned int flags); }
680437 UNIMPL 685437 UNIMPL
681438 UNIMPL 686438 UNIMPL
682439 UNIMPL 687439 UNIMPL
683440 UNIMPL 688440 UNIMPL
684441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 689441 STD { int|linux_sys||epoll_pwait2(int epfd, \
685 struct linux_epoll_event *events, int maxevents, \ 690 struct linux_epoll_event *events, int maxevents, \
686 const struct linux_timespec *timeout, \ 691 const struct linux_timespec *timeout, \
687 const linux_sigset_t *sigmask); } 692 const linux_sigset_t *sigmask); }

cvs diff -r1.81 -r1.82 src/sys/compat/linux/arch/powerpc/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/linux/arch/powerpc/syscalls.master 2023/07/28 19:01:11 1.81
+++ src/sys/compat/linux/arch/powerpc/syscalls.master 2023/07/29 15:04:29 1.82
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.81 2023/07/28 19:01:11 christos Exp $  1 $NetBSD: syscalls.master,v 1.82 2023/07/29 15:04:29 christos Exp $
2 2
3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
4 4
5; Derived from NetBSD's sys/compat/linux/arch/i386/syscalls.master 5; Derived from NetBSD's sys/compat/linux/arch/i386/syscalls.master
6; sys/compat/linux/arch/m68k/syscalls.master 6; sys/compat/linux/arch/m68k/syscalls.master
7; and from Linux's arch/ppc/kernel/misc.S 7; and from Linux's arch/ppc/kernel/misc.S
8; 8;
9; We have problems for a few syscalls, specially: 9; We have problems for a few syscalls, specially:
10; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???). 10; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???).
11; 11;
12; Expect problems with the following, which have an architecture dependent 12; Expect problems with the following, which have an architecture dependent
13; implementation in Linux/powerpc: 13; implementation in Linux/powerpc:
14; 29 pause 14; 29 pause
@@ -347,27 +347,28 @@ @@ -347,27 +347,28 @@
347 gid_t gid); } 347 gid_t gid); }
348182 NOARGS { int|sys||__getcwd(char *bufp, size_t length); } 348182 NOARGS { int|sys||__getcwd(char *bufp, size_t length); }
349183 UNIMPL capget 349183 UNIMPL capget
350184 UNIMPL capset 350184 UNIMPL capset
351185 STD { int|linux_sys||sigaltstack( \ 351185 STD { int|linux_sys||sigaltstack( \
352 const struct linux_sigaltstack *ss, \ 352 const struct linux_sigaltstack *ss, \
353 struct linux_sigaltstack *oss); } 353 struct linux_sigaltstack *oss); }
354186 UNIMPL sendfile 354186 UNIMPL sendfile
355187 UNIMPL getpmsg 355187 UNIMPL getpmsg
356188 UNIMPL putpmsg 356188 UNIMPL putpmsg
357189 NOARGS { int|sys|14|vfork(void); } 357189 NOARGS { int|sys|14|vfork(void); }
358190 STD { int|linux_sys||ugetrlimit(int which, \ 358190 STD { int|linux_sys||ugetrlimit(int which, \
359 struct rlimit *rlp); } 359 struct rlimit *rlp); }
360191 UNIMPL /* unused */ 360191 STD { ssize_t|linux_sys||readahead(int fd, off_t offset, \
 361 size_t count); }
361#define linux_sys_mmap2_args linux_sys_mmap_args 362#define linux_sys_mmap2_args linux_sys_mmap_args
362192 NOARGS { linux_off_t|linux_sys||mmap2(unsigned long addr, \ 363192 NOARGS { linux_off_t|linux_sys||mmap2(unsigned long addr, \
363 size_t len, int prot, int flags, int fd, \ 364 size_t len, int prot, int flags, int fd, \
364 linux_off_t offset); } 365 linux_off_t offset); }
365193 STD { int|linux_sys||truncate64(const char *path, \ 366193 STD { int|linux_sys||truncate64(const char *path, \
366 off_t length); } 367 off_t length); }
367194 STD { int|linux_sys||ftruncate64(unsigned int fd, \ 368194 STD { int|linux_sys||ftruncate64(unsigned int fd, \
368 off_t length); } 369 off_t length); }
369195 STD { int|linux_sys||stat64(const char *path, \ 370195 STD { int|linux_sys||stat64(const char *path, \
370 struct linux_stat64 *sp); } 371 struct linux_stat64 *sp); }
371196 STD { int|linux_sys||lstat64(const char *path, \ 372196 STD { int|linux_sys||lstat64(const char *path, \
372 struct linux_stat64 *sp); } 373 struct linux_stat64 *sp); }
373197 STD { int|linux_sys||fstat64(int fd, \ 374197 STD { int|linux_sys||fstat64(int fd, \
@@ -623,27 +624,29 @@ @@ -623,27 +624,29 @@
623370 UNIMPL 624370 UNIMPL
624371 UNIMPL 625371 UNIMPL
625372 UNIMPL 626372 UNIMPL
626373 UNIMPL 627373 UNIMPL
627374 UNIMPL 628374 UNIMPL
628375 UNIMPL 629375 UNIMPL
629376 UNIMPL 630376 UNIMPL
630377 UNIMPL 631377 UNIMPL
631378 UNIMPL mlock2 632378 UNIMPL mlock2
632379 UNIMPL copy_file_range 633379 UNIMPL copy_file_range
633380 UNIMPL preadv2 634380 UNIMPL preadv2
634381 UNIMPL pwritev2 635381 UNIMPL pwritev2
635382 UNIMPL kexec_file_load 636382 UNIMPL kexec_file_load
636383 UNIMPL 637383 STD { int|linux_sys||statx(int fd, const char *path, \
 638 int flag, unsigned int mask, \
 639 struct linux_statx *sp); }
637384 UNIMPL 640384 UNIMPL
638385 UNIMPL 641385 UNIMPL
639386 UNIMPL 642386 UNIMPL
640387 UNIMPL 643387 UNIMPL
641388 UNIMPL 644388 UNIMPL
642389 UNIMPL 645389 UNIMPL
643390 UNIMPL 646390 UNIMPL
644391 UNIMPL 647391 UNIMPL
645392 UNIMPL 648392 UNIMPL
646393 UNIMPL 649393 UNIMPL
647394 UNIMPL 650394 UNIMPL
648395 UNIMPL 651395 UNIMPL
649396 UNIMPL 652396 UNIMPL
@@ -676,22 +679,23 @@ @@ -676,22 +679,23 @@
676423 UNIMPL 679423 UNIMPL
677424 UNIMPL 680424 UNIMPL
678425 UNIMPL 681425 UNIMPL
679426 UNIMPL 682426 UNIMPL
680427 UNIMPL 683427 UNIMPL
681428 UNIMPL 684428 UNIMPL
682429 UNIMPL 685429 UNIMPL
683430 UNIMPL 686430 UNIMPL
684431 UNIMPL 687431 UNIMPL
685432 UNIMPL 688432 UNIMPL
686433 UNIMPL 689433 UNIMPL
687434 UNIMPL 690434 UNIMPL
688435 UNIMPL 691435 UNIMPL
689436 UNIMPL 692436 STD { int|linux_sys||close_range(unsigned int first, \
 693 unsigned int last, unsigned int flags); }
690437 UNIMPL 694437 UNIMPL
691438 UNIMPL 695438 UNIMPL
692439 UNIMPL 696439 UNIMPL
693440 UNIMPL 697440 UNIMPL
694441 STD { int|linux_sys||epoll_pwait2(int epfd, \ 698441 STD { int|linux_sys||epoll_pwait2(int epfd, \
695 struct linux_epoll_event *events, int maxevents, \ 699 struct linux_epoll_event *events, int maxevents, \
696 const struct linux_timespec *timeout, \ 700 const struct linux_timespec *timeout, \
697 const linux_sigset_t *sigmask); } 701 const linux_sigset_t *sigmask); }

cvs diff -r1.67 -r1.68 src/sys/compat/linux/common/linux_file64.c (expand / switch to unified diff)

--- src/sys/compat/linux/common/linux_file64.c 2021/11/25 02:27:08 1.67
+++ src/sys/compat/linux/common/linux_file64.c 2023/07/29 15:04:29 1.68
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux_file64.c,v 1.67 2021/11/25 02:27:08 ryo Exp $ */ 1/* $NetBSD: linux_file64.c,v 1.68 2023/07/29 15:04:29 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 1995, 1998, 2000, 2008 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. 8 * by Frank van der Linden and Eric Haszlakiewicz.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Linux 64bit filesystem calls. Used on 32bit archs, not used on 64bit ones. 33 * Linux 64bit filesystem calls. Used on 32bit archs, not used on 64bit ones.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.67 2021/11/25 02:27:08 ryo Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.68 2023/07/29 15:04:29 christos Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/namei.h> 41#include <sys/namei.h>
42#include <sys/proc.h> 42#include <sys/proc.h>
43#include <sys/dirent.h> 43#include <sys/dirent.h>
44#include <sys/file.h> 44#include <sys/file.h>
45#include <sys/stat.h> 45#include <sys/stat.h>
46#include <sys/filedesc.h> 46#include <sys/filedesc.h>
47#include <sys/ioctl.h> 47#include <sys/ioctl.h>
48#include <sys/kernel.h> 48#include <sys/kernel.h>
49#include <sys/mount.h> 49#include <sys/mount.h>
50#include <sys/malloc.h> 50#include <sys/malloc.h>
@@ -242,26 +242,30 @@ linux_sys_lstat64(struct lwp *l, const s @@ -242,26 +242,30 @@ linux_sys_lstat64(struct lwp *l, const s
242/* 242/*
243 * This is an internal function for the *statat() variant of linux, 243 * This is an internal function for the *statat() variant of linux,
244 * which returns struct stat, but flags and other handling are 244 * which returns struct stat, but flags and other handling are
245 * the same as in linux. 245 * the same as in linux.
246 */ 246 */
247int 247int
248linux_statat(struct lwp *l, int fd, const char *path, int lflag, 248linux_statat(struct lwp *l, int fd, const char *path, int lflag,
249 struct stat *st) 249 struct stat *st)
250{ 250{
251 struct vnode *vp; 251 struct vnode *vp;
252 int error, nd_flag; 252 int error, nd_flag;
253 uint8_t c; 253 uint8_t c;
254 254
 255 if (lflag & ~(LINUX_AT_EMPTY_PATH|LINUX_AT_NO_AUTOMOUNT
 256 |LINUX_AT_SYMLINK_NOFOLLOW))
 257 return EINVAL;
 258
255 if (lflag & LINUX_AT_EMPTY_PATH) { 259 if (lflag & LINUX_AT_EMPTY_PATH) {
256 /* 260 /*
257 * If path is null string: 261 * If path is null string:
258 */ 262 */
259 error = ufetch_8(path, &c); 263 error = ufetch_8(path, &c);
260 if (error != 0) 264 if (error != 0)
261 return error; 265 return error;
262 if (c == '\0') { 266 if (c == '\0') {
263 if (fd == LINUX_AT_FDCWD) { 267 if (fd == LINUX_AT_FDCWD) {
264 /* 268 /*
265 * operate on current directory 269 * operate on current directory
266 */ 270 */
267 vp = l->l_proc->p_cwdi->cwdi_cdir; 271 vp = l->l_proc->p_cwdi->cwdi_cdir;

cvs diff -r1.259 -r1.260 src/sys/compat/linux/common/linux_misc.c (expand / switch to unified diff)

--- src/sys/compat/linux/common/linux_misc.c 2023/07/29 07:00:00 1.259
+++ src/sys/compat/linux/common/linux_misc.c 2023/07/29 15:04:29 1.260
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux_misc.c,v 1.259 2023/07/29 07:00:00 rin Exp $ */ 1/* $NetBSD: linux_misc.c,v 1.260 2023/07/29 15:04:29 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 1995, 1998, 1999, 2008 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 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * linux_sys_readdir : linux_misc_notalpha.c 47 * linux_sys_readdir : linux_misc_notalpha.c
48 * linux_sys_setresgid : linux_misc_notalpha.c 48 * linux_sys_setresgid : linux_misc_notalpha.c
49 * linux_sys_time : linux_misc_notalpha.c 49 * linux_sys_time : linux_misc_notalpha.c
50 * linux_sys_utime : linux_misc_notalpha.c 50 * linux_sys_utime : linux_misc_notalpha.c
51 * linux_sys_waitpid : linux_misc_notalpha.c 51 * linux_sys_waitpid : linux_misc_notalpha.c
52 * linux_sys_old_mmap : linux_oldmmap.c 52 * linux_sys_old_mmap : linux_oldmmap.c
53 * linux_sys_oldolduname : linux_oldolduname.c 53 * linux_sys_oldolduname : linux_oldolduname.c
54 * linux_sys_oldselect : linux_oldselect.c 54 * linux_sys_oldselect : linux_oldselect.c
55 * linux_sys_olduname : linux_olduname.c 55 * linux_sys_olduname : linux_olduname.c
56 * linux_sys_pipe : linux_pipe.c 56 * linux_sys_pipe : linux_pipe.c
57 */ 57 */
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.259 2023/07/29 07:00:00 rin Exp $"); 60__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.260 2023/07/29 15:04:29 christos Exp $");
61 61
62#include <sys/param.h> 62#include <sys/param.h>
63#include <sys/systm.h> 63#include <sys/systm.h>
64#include <sys/namei.h> 64#include <sys/namei.h>
65#include <sys/proc.h> 65#include <sys/proc.h>
66#include <sys/dirent.h> 66#include <sys/dirent.h>
67#include <sys/epoll.h> 67#include <sys/epoll.h>
68#include <sys/eventfd.h> 68#include <sys/eventfd.h>
69#include <sys/file.h> 69#include <sys/file.h>
70#include <sys/stat.h> 70#include <sys/stat.h>
71#include <sys/filedesc.h> 71#include <sys/filedesc.h>
72#include <sys/ioctl.h> 72#include <sys/ioctl.h>
73#include <sys/kernel.h> 73#include <sys/kernel.h>
@@ -1967,13 +1967,93 @@ linux_sys_memfd_create(struct lwp *l, @@ -1967,13 +1967,93 @@ linux_sys_memfd_create(struct lwp *l,
1967 return error; 1967 return error;
1968 } 1968 }
1969 1969
1970 if (lflags & ~LINUX_MFD_KNOWN_FLAGS) { 1970 if (lflags & ~LINUX_MFD_KNOWN_FLAGS) {
1971 DPRINTF(("linux_sys_memfd_create: ignored flags %x\n", 1971 DPRINTF(("linux_sys_memfd_create: ignored flags %x\n",
1972 lflags & ~LINUX_MFD_KNOWN_FLAGS)); 1972 lflags & ~LINUX_MFD_KNOWN_FLAGS));
1973 } 1973 }
1974 1974
1975 SCARG(&muap, name) = SCARG(uap, name); 1975 SCARG(&muap, name) = SCARG(uap, name);
1976 SCARG(&muap, flags) = lflags & LINUX_MFD_KNOWN_FLAGS; 1976 SCARG(&muap, flags) = lflags & LINUX_MFD_KNOWN_FLAGS;
1977 1977
1978 return sys_memfd_create(l, &muap, retval); 1978 return sys_memfd_create(l, &muap, retval);
1979} 1979}
 1980
 1981#define LINUX_CLOSE_RANGE_UNSHARE 0x02U
 1982#define LINUX_CLOSE_RANGE_CLOEXEC 0x04U
 1983
 1984/*
 1985 * close_range(2).
 1986 */
 1987int
 1988linux_sys_close_range(struct lwp *l,
 1989 const struct linux_sys_close_range_args *uap, register_t *retval)
 1990{
 1991 /* {
 1992 syscallarg(unsigned int) first;
 1993 syscallarg(unsigned int) last;
 1994 syscallarg(unsigned int) flags;
 1995 } */
 1996 unsigned int fd, last;
 1997 file_t *fp;
 1998 filedesc_t *fdp;
 1999 const unsigned int flags = SCARG(uap, flags);
 2000
 2001 if (flags & ~(LINUX_CLOSE_RANGE_CLOEXEC|LINUX_CLOSE_RANGE_UNSHARE))
 2002 return EINVAL;
 2003 if (SCARG(uap, first) > SCARG(uap, last))
 2004 return EINVAL;
 2005
 2006 if (flags & LINUX_CLOSE_RANGE_UNSHARE) {
 2007 fdp = fd_copy();
 2008 fd_free();
 2009 l->l_proc->p_fd = fdp;
 2010 l->l_fd = fdp;
 2011 }
 2012
 2013 last = MIN(SCARG(uap, last), l->l_proc->p_fd->fd_lastfile);
 2014 for (fd = SCARG(uap, first); fd <= last; fd++) {
 2015 fp = fd_getfile(fd);
 2016 if (fp == NULL)
 2017 continue;
 2018
 2019 if (flags & LINUX_CLOSE_RANGE_CLOEXEC) {
 2020 fd_set_exclose(l, fd, true);
 2021 fd_putfile(fd);
 2022 } else
 2023 fd_close(fd);
 2024 }
 2025
 2026 return 0;
 2027}
 2028
 2029/*
 2030 * readahead(2). Call posix_fadvise with POSIX_FADV_WILLNEED with some extra
 2031 * error checking.
 2032 */
 2033int
 2034linux_sys_readahead(struct lwp *l, const struct linux_sys_readahead_args *uap,
 2035 register_t *retval)
 2036{
 2037 /* {
 2038 syscallarg(int) fd;
 2039 syscallarg(off_t) offset;
 2040 syscallarg(size_t) count;
 2041 } */
 2042 file_t *fp;
 2043 int error = 0;
 2044 const int fd = SCARG(uap, fd);
 2045
 2046 fp = fd_getfile(fd);
 2047 if (fp == NULL)
 2048 return EBADF;
 2049 if ((fp->f_flag & FREAD) == 0)
 2050 error = EBADF;
 2051 else if (fp->f_type != DTYPE_VNODE || fp->f_vnode->v_type != VREG)
 2052 error = EINVAL;
 2053 fd_putfile(fd);
 2054 if (error != 0)
 2055 return error;
 2056
 2057 return do_posix_fadvise(fd, SCARG(uap, offset), SCARG(uap, count),
 2058 POSIX_FADV_WILLNEED);
 2059}