svn commit: r313284 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux

Dmitry Chagin dchagin at FreeBSD.org
Sun Feb 5 14:17:12 UTC 2017


Author: dchagin
Date: Sun Feb  5 14:17:09 2017
New Revision: 313284
URL: https://svnweb.freebsd.org/changeset/base/313284

Log:
  Update syscall.master to 4.10-rc6. Also fix comments, a typo,
  and wrong numbering for a few unimplemented syscalls.
  
  For 32-bit Linuxulator, socketcall() syscall was historically
  the entry point for the sockets API. Starting in Linux 4.3, direct
  syscalls are provided for the sockets API. Enable it.
  
  The initial version of patch was provided by trasz@ and extended by me.
  
  Submitted by:	trasz
  MFC after:	2 week
  Differential Revision:	https://reviews.freebsd.org/D9381

Modified:
  head/sys/amd64/linux/linux_dummy.c
  head/sys/amd64/linux/syscalls.master
  head/sys/amd64/linux32/linux32_dummy.c
  head/sys/amd64/linux32/syscalls.master
  head/sys/compat/linux/linux_socket.h
  head/sys/i386/linux/linux_dummy.c
  head/sys/i386/linux/syscalls.master

Modified: head/sys/amd64/linux/linux_dummy.c
==============================================================================
--- head/sys/amd64/linux/linux_dummy.c	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/amd64/linux/linux_dummy.c	Sun Feb  5 14:17:09 2017	(r313284)
@@ -82,41 +82,86 @@ DUMMY(mq_timedreceive);
 DUMMY(mq_notify);
 DUMMY(mq_getsetattr);
 DUMMY(kexec_load);
+/* linux 2.6.11: */
 DUMMY(add_key);
 DUMMY(request_key);
 DUMMY(keyctl);
+/* linux 2.6.13: */
 DUMMY(ioprio_set);
 DUMMY(ioprio_get);
 DUMMY(inotify_init);
 DUMMY(inotify_add_watch);
 DUMMY(inotify_rm_watch);
+/* linux 2.6.16: */
 DUMMY(migrate_pages);
 DUMMY(unshare);
+/* linux 2.6.17: */
 DUMMY(splice);
 DUMMY(tee);
 DUMMY(sync_file_range);
 DUMMY(vmsplice);
+/* linux 2.6.18: */
 DUMMY(move_pages);
+/* linux 2.6.22: */
 DUMMY(signalfd);
-DUMMY(timerfd);
+DUMMY(timerfd_create);
+/* linux 2.6.25: */
 DUMMY(timerfd_settime);
 DUMMY(timerfd_gettime);
+/* linux 2.6.27: */
 DUMMY(signalfd4);
 DUMMY(inotify_init1);
+/* linux 2.6.30: */
 DUMMY(preadv);
 DUMMY(pwritev);
-DUMMY(rt_tsigqueueinfo);
+/* linux 2.6.31: */
+DUMMY(rt_tgsigqueueinfo);
 DUMMY(perf_event_open);
+/* linux 2.6.38: */
 DUMMY(fanotify_init);
 DUMMY(fanotify_mark);
+/* linux 2.6.39: */
 DUMMY(name_to_handle_at);
 DUMMY(open_by_handle_at);
 DUMMY(clock_adjtime);
+/* linux 3.0: */
 DUMMY(setns);
+DUMMY(getcpu);
+/* linux 3.2: */
 DUMMY(process_vm_readv);
 DUMMY(process_vm_writev);
+/* linux 3.5: */
 DUMMY(kcmp);
+/* linux 3.8: */
 DUMMY(finit_module);
+DUMMY(sched_setattr);
+DUMMY(sched_getattr);
+/* linux 3.14: */
+DUMMY(renameat2);
+/* linux 3.15: */
+DUMMY(seccomp);
+DUMMY(getrandom);
+DUMMY(memfd_create);
+DUMMY(kexec_file_load);
+/* linux 3.18: */
+DUMMY(bpf);
+/* linux 3.19: */
+DUMMY(execveat);
+/* linux 4.2: */
+DUMMY(userfaultfd);
+/* linux 4.3: */
+DUMMY(membarrier);
+/* linux 4.4: */
+DUMMY(mlock2);
+/* linux 4.5: */
+DUMMY(copy_file_range);
+/* linux 4.6: */
+DUMMY(preadv2);
+DUMMY(pwritev2);
+/* linux 4.8: */
+DUMMY(pkey_mprotect);
+DUMMY(pkey_alloc);
+DUMMY(pkey_free);
 
 #define DUMMY_XATTR(s)						\
 int								\

Modified: head/sys/amd64/linux/syscalls.master
==============================================================================
--- head/sys/amd64/linux/syscalls.master	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/amd64/linux/syscalls.master	Sun Feb  5 14:17:09 2017	(r313284)
@@ -11,18 +11,20 @@
 ;		there is no audit event for the call at this time. For the
 ;		case where the event exists, but we don't want auditing, the
 ;		event should be #defined to AUE_NULL in audit_kevents.h.
-;	type	one of STD, OBSOL, UNIMPL
+;	type	one of STD, NOPROTO, UNIMPL
 ;	name	psuedo-prototype of syscall routine
 ;		If one of the following alts is different, then all appear:
 ;	altname	name of system call if different
 ;	alttag	name of args struct tag if different from [o]`name'"_args"
 ;	altrtyp	return type if not int (bogus - syscalls always return int)
-;		for UNIMPL/OBSOL, name continues with comments
+;		for UNIMPL, name continues with comments
 
 ; types:
 ;	STD	always included
-;	OBSOL	obsolete, not included in system, only specifies name
 ;	UNIMPL	not implemented, placeholder only
+;	NOPROTO	same as STD except do not create structure or
+;		function prototype in sys/sysproto.h.  Does add a
+;		definition to syscall.h besides adding a sysent.
 
 #include <sys/param.h>
 #include <sys/sysent.h>
@@ -369,7 +371,7 @@
 206	AUE_NULL	UNIMPL	linux_io_setup
 207	AUE_NULL	UNIMPL	linux_io_destroy
 208	AUE_NULL	UNIMPL	linux_io_getevents
-209	AUE_NULL	UNIMPL	inux_io_submit
+209	AUE_NULL	UNIMPL	linux_io_submit
 210	AUE_NULL	UNIMPL	linux_io_cancel
 211	AUE_NULL	UNIMPL	linux_get_thread_area
 212	AUE_NULL	STD	{ int linux_lookup_dcookie(void); }
@@ -473,7 +475,7 @@
 281     AUE_NULL        STD     { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
                                         l_int maxevents, l_int timeout, l_sigset_t *mask); }
 282	AUE_NULL	STD	{ int linux_signalfd(void); }
-283	AUE_NULL	STD	{ int linux_timerfd(void); }
+283	AUE_NULL	STD	{ int linux_timerfd_create(void); }
 284	AUE_NULL	STD	{ int linux_eventfd(l_uint initval); }
 285	AUE_NULL	STD	{ int linux_fallocate(l_int fd, l_int mode, \
 				    l_loff_t offset, l_loff_t len); }
@@ -481,35 +483,114 @@
 287	AUE_NULL	STD	{ int linux_timerfd_gettime(void); }
 288	AUE_ACCEPT	STD	{ int linux_accept4(l_int s, l_uintptr_t addr, \
 				    l_uintptr_t namelen, int flags); }
+; linux 2.6.27:
 289	AUE_NULL	STD	{ int linux_signalfd4(void); }
 290	AUE_NULL	STD	{ int linux_eventfd2(l_uint initval, l_int flags); }
 291	AUE_NULL	STD	{ int linux_epoll_create1(l_int flags); }
 292	AUE_NULL	STD	{ int linux_dup3(l_int oldfd,		\
 				    l_int newfd, l_int flags); }
 293	AUE_NULL	STD	{ int linux_pipe2(l_int *pipefds, l_int flags); }
-294	AUE_NULL	STD	{ int linux_inotify_init1(void); }
-295	AUE_NULL	STD	{ int linux_preadv(void); }
-296	AUE_NULL	STD	{ int linux_pwritev(void); }
-297	AUE_NULL	STD	{ int linux_rt_tsigqueueinfo(void); }
+294	AUE_NULL	STD	{ int linux_inotify_init1(l_int flags); }
+; linux 2.6.30:
+295	AUE_NULL	STD	{ int linux_preadv(l_ulong fd, 			\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
+296	AUE_NULL	STD	{ int linux_pwritev(l_ulong fd, 		\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
+; linux 2.6.31:
+297	AUE_NULL	STD	{ int linux_rt_tgsigqueueinfo(l_pid_t tgid,	\
+				    l_pid_t tid, l_int sig, l_siginfo_t *uinfo); }
 298	AUE_NULL	STD	{ int linux_perf_event_open(void); }
+; linux 2.6.33:
 299	AUE_NULL	STD	{ int linux_recvmmsg(l_int s,			\
 				    struct l_mmsghdr *msg, l_uint vlen,		\
 				    l_uint flags, struct l_timespec *timeout); }
+; linux 2.6.37:
 300	AUE_NULL	STD	{ int linux_fanotify_init(void); }
 301	AUE_NULL	STD	{ int linux_fanotify_mark(void); }
+; linux 2.6.36:
 302	AUE_NULL	STD	{ int linux_prlimit64(l_pid_t pid, l_uint resource, \
 				    struct rlimit *new, struct rlimit *old); }
+; linux 2.6.39 (glibc 2.14):
 303	AUE_NULL	STD	{ int linux_name_to_handle_at(void); }
 304	AUE_NULL	STD	{ int linux_open_by_handle_at(void); }
 305	AUE_NULL	STD	{ int linux_clock_adjtime(void); }
 306	AUE_SYNC	STD	{ int linux_syncfs(l_int fd); }
+; linux 3.0 (glibc 2.14):
 307	AUE_NULL	STD	{ int linux_sendmmsg(l_int s,			\
 				    struct l_mmsghdr *msg, l_uint vlen,		\
 				    l_uint flags); }
-308	AUE_NULL	STD	{ int linux_setns(void); }
-309	AUE_NULL	STD	{ int linux_process_vm_readv(void); }
-310	AUE_NULL	STD	{ int linux_process_vm_writev(void); }
-311	AUE_NULL	STD	{ int linux_kcmp(void); }
-312	AUE_NULL	STD	{ int linux_finit_module(void); }
+308	AUE_NULL	STD	{ int linux_setns(l_int fd, l_int nstype); }
+; linux 2.6.19 (no glibc wrapper):
+309	AUE_NULL	STD	{ int linux_getcpu(l_uint *cpu, l_uint *node,	\
+				    void *cache); }
+; linux 3.2 (glibc 2.15):
+310	AUE_NULL	STD	{ int linux_process_vm_readv(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+311	AUE_NULL	STD	{ int linux_process_vm_writev(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+; linux 3.5 (no glibc wrapper):
+312	AUE_NULL	STD	{ int linux_kcmp(l_pid_t pid1, l_pid_t pid2,	\
+				    l_int type, l_ulong idx1, l_ulong idx); }
+; linux 3.8 (no glibc wrapper):
+313	AUE_NULL	STD	{ int linux_finit_module(l_int fd,		\
+				    const char *uargs, l_int flags); }
+; linux 3.14:
+314	AUE_NULL	STD	{ int linux_sched_setattr(l_pid_t pid,		\
+				    void *attr, l_uint flags); }
+315	AUE_NULL	STD	{ int linux_sched_getattr(l_pid_t pid,		\
+				    void *attr, l_uint size, l_uint flags); }
+; linux 3.15:
+316	AUE_NULL	STD	{ int linux_renameat2(l_int oldfd,		\
+				    const char *oldname, l_int newfd, 		\
+				    const char *newname, unsigned int flags); }
+; linux 3.17:
+317	AUE_NULL	STD	{ int linux_seccomp(l_uint op, l_uint flags,	\
+				    const char *uargs); }
+318	AUE_NULL	STD	{ int linux_getrandom(char *buf,		\
+				    l_size_t count, l_uint flags); }
+319	AUE_NULL	STD	{ int linux_memfd_create(const char *uname_ptr,	\
+				    l_uint flags); }
+320	AUE_NULL	STD	{ int linux_kexec_file_load(l_int kernel_fd,	\
+				    l_int initrd_fd, l_ulong cmdline_len,	\
+				    const char *cmdline_ptr, l_ulong flags); }
+; linux 3.18:
+321	AUE_NULL	STD	{ int linux_bpf(l_int cmd, void *attr,		\
+				    l_uint size); }
+; linux 3.19:
+322	AUE_NULL	STD	{ int linux_execveat(l_int dfd,			\
+				    const char *filename, const char **argv,	\
+				    const char **envp, l_int flags); }
+; linux 4.2:
+323	AUE_NULL	STD	{ int linux_userfaultfd(l_int flags); }
+; linux 4.3:
+324	AUE_NULL	STD	{ int linux_membarrier(l_int cmd, l_int flags); }
+; linux 4.4:
+325	AUE_NULL	STD	{ int linux_mlock2(l_ulong start, l_size_t len,	\
+				    l_int flags); }
+; linux 4.5:
+326	AUE_NULL	STD	{ int linux_copy_file_range(l_int fd_in,	\
+				    l_loff_t *off_in, l_int fd_out,		\
+				    l_loff_t *off_out, l_size_t len,		\
+				    l_uint flags); }
+; linux 4.6:
+327	AUE_NULL	STD	{ int linux_preadv2(l_ulong fd,			\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+328	AUE_NULL	STD	{ int linux_pwritev2(l_ulong fd,		\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+; linux 4.8:
+329	AUE_NULL	STD	{ int linux_pkey_mprotect(l_ulong start,	\
+				    l_size_t len, l_ulong prot, l_int pkey); }
+330	AUE_NULL	STD	{ int linux_pkey_alloc(l_ulong flags,		\
+				    l_ulong init_val); }
+331	AUE_NULL	STD	{ int linux_pkey_free(l_int pkey); }
+
 ; please, keep this line at the end.
-313	AUE_NULL	UNIMPL	nosys
+332	AUE_NULL	UNIMPL	nosys

Modified: head/sys/amd64/linux32/linux32_dummy.c
==============================================================================
--- head/sys/amd64/linux32/linux32_dummy.c	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/amd64/linux32/linux32_dummy.c	Sun Feb  5 14:17:09 2017	(r313284)
@@ -114,18 +114,51 @@ DUMMY(inotify_init1);
 DUMMY(preadv);
 DUMMY(pwritev);
 /* linux 2.6.31: */
-DUMMY(rt_tsigqueueinfo);
+DUMMY(rt_tgsigqueueinfo);
 DUMMY(perf_event_open);
 /* linux 2.6.33: */
 DUMMY(fanotify_init);
 DUMMY(fanotify_mark);
-/* later: */
+/* linux 2.6.39: */
 DUMMY(name_to_handle_at);
 DUMMY(open_by_handle_at);
 DUMMY(clock_adjtime);
+/* linux 3.0: */
 DUMMY(setns);
+/* linux 3.2: */
 DUMMY(process_vm_readv);
 DUMMY(process_vm_writev);
+/* linux 3.5: */
+DUMMY(kcmp);
+/* linux 3.8: */
+DUMMY(finit_module);
+DUMMY(sched_setattr);
+DUMMY(sched_getattr);
+/* linux 3.14: */
+DUMMY(renameat2);
+/* linux 3.15: */
+DUMMY(seccomp);
+DUMMY(getrandom);
+DUMMY(memfd_create);
+/* linux 3.18: */
+DUMMY(bpf);
+/* linux 3.19: */
+DUMMY(execveat);
+/* linux 4.2: */
+DUMMY(userfaultfd);
+/* linux 4.3: */
+DUMMY(membarrier);
+/* linux 4.4: */
+DUMMY(mlock2);
+/* linux 4.5: */
+DUMMY(copy_file_range);
+/* linux 4.6: */
+DUMMY(preadv2);
+DUMMY(pwritev2);
+/* linux 4.8: */
+DUMMY(pkey_mprotect);
+DUMMY(pkey_alloc);
+DUMMY(pkey_free);
 
 #define DUMMY_XATTR(s)						\
 int								\

Modified: head/sys/amd64/linux32/syscalls.master
==============================================================================
--- head/sys/amd64/linux32/syscalls.master	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/amd64/linux32/syscalls.master	Sun Feb  5 14:17:09 2017	(r313284)
@@ -11,18 +11,20 @@
 ;		there is no audit event for the call at this time. For the
 ;		case where the event exists, but we don't want auditing, the
 ;		event should be #defined to AUE_NULL in audit_kevents.h.
-;	type	one of STD, OBSOL, UNIMPL
+;	type	one of STD, NOPROTO, UNIMPL
 ;	name	psuedo-prototype of syscall routine
 ;		If one of the following alts is different, then all appear:
 ;	altname	name of system call if different
 ;	alttag	name of args struct tag if different from [o]`name'"_args"
 ;	altrtyp	return type if not int (bogus - syscalls always return int)
-;		for UNIMPL/OBSOL, name continues with comments
+;		for UNIMPL, name continues with comments
 
 ; types:
 ;	STD	always included
-;	OBSOL	obsolete, not included in system, only specifies name
 ;	UNIMPL	not implemented, placeholder only
+;	NOPROTO same as STD except do not create structure or
+;		function prototype in sys/sysproto.h.  Does add a
+;		definition to syscall.h besides adding a sysent.
 
 #include "opt_compat.h"
 #include <sys/param.h>
@@ -553,10 +555,15 @@
 331	AUE_NULL	STD	{ int linux_pipe2(l_int *pipefds, l_int flags); }
 332	AUE_NULL	STD	{ int linux_inotify_init1(void); }
 ; linux 2.6.30:
-333	AUE_NULL	STD	{ int linux_preadv(void); }
-334	AUE_NULL	STD	{ int linux_pwritev(void); }
+333	AUE_NULL	STD	{ int linux_preadv(l_ulong fd, 			\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
+334	AUE_NULL	STD	{ int linux_pwritev(l_ulong fd, 		\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
 ; linux 2.6.31:
-335	AUE_NULL	STD	{ int linux_rt_tsigqueueinfo(void); }
+335	AUE_NULL	STD	{ int linux_rt_tgsigqueueinfo(l_pid_t tgid,	\
+				    l_pid_t tid, l_int sig, l_siginfo_t *uinfo); }
 336	AUE_NULL	STD	{ int linux_perf_event_open(void); }
 ; linux 2.6.33:
 337	AUE_NULL	STD	{ int linux_recvmmsg(l_int s,			\
@@ -569,16 +576,113 @@
 				    l_uint resource,			\
 				    struct rlimit *new,			\
 				    struct rlimit *old); }
-; later:
+; linux 2.6.39:
 341	AUE_NULL	STD	{ int linux_name_to_handle_at(void); }
 342	AUE_NULL	STD	{ int linux_open_by_handle_at(void); }
 343	AUE_NULL	STD	{ int linux_clock_adjtime(void); }
 344	AUE_SYNC	STD	{ int linux_syncfs(l_int fd); }
+; linux 3.0:
 345	AUE_NULL	STD	{ int linux_sendmmsg(l_int s,			\
 				    struct l_mmsghdr *msg, l_uint vlen,		\
 				    l_uint flags); }
 346	AUE_NULL	STD	{ int linux_setns(void); }
-347	AUE_NULL	STD	{ int linux_process_vm_readv(void); }
-348	AUE_NULL	STD	{ int linux_process_vm_writev(void); }
+; linux 3.2 (glibc 2.15):
+347	AUE_NULL	STD	{ int linux_process_vm_readv(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+348	AUE_NULL	STD	{ int linux_process_vm_writev(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+; linux 3.5 (no glibc wrapper):
+349	AUE_NULL	STD	{ int linux_kcmp(l_pid_t pid1, l_pid_t pid2,	\
+				    l_int type, l_ulong idx1, l_ulong idx); }
+; linux 3.8 (no glibc wrapper):
+350	AUE_NULL	STD	{ int linux_finit_module(l_int fd,		\
+				    const char *uargs, l_int flags); }
+; linux 3.14:
+351	AUE_NULL	STD	{ int linux_sched_setattr(l_pid_t pid,		\
+				    void *attr, l_uint flags); }
+352	AUE_NULL	STD	{ int linux_sched_getattr(l_pid_t pid,		\
+				    void *attr, l_uint size, l_uint flags); }
+; linux 3.15:
+353	AUE_NULL	STD	{ int linux_renameat2(l_int oldfd,		\
+				    const char *oldname, l_int newfd, 		\
+				    const char *newname, unsigned int flags); }
+; linux 3.17:
+354	AUE_NULL	STD	{ int linux_seccomp(l_uint op, l_uint flags,	\
+				    const char *uargs); }
+355	AUE_NULL	STD	{ int linux_getrandom(char *buf,		\
+				    l_size_t count, l_uint flags); }
+356	AUE_NULL	STD	{ int linux_memfd_create(const char *uname_ptr,	\
+				    l_uint flags); }
+; linux 3.18:
+357	AUE_NULL	STD	{ int linux_bpf(l_int cmd, void *attr,		\
+				    l_uint size); }
+; linux 3.19:
+358	AUE_NULL	STD	{ int linux_execveat(l_int dfd,			\
+				    const char *filename, const char **argv,	\
+				    const char **envp, l_int flags); }
+; linux 4.3: sockets now direct system calls:
+359	AUE_SOCKET	STD	{ int linux_socket(l_int domain, l_int type, \
+				    l_int protocol); }
+360	AUE_SOCKETPAIR	STD	{ int linux_socketpair(l_int domain, \
+				    l_int type, l_int protocol, l_uintptr_t rsv); }
+361	AUE_BIND	STD	{ int linux_bind(l_int s, l_uintptr_t name, \
+				    l_int namelen); }
+362	AUE_CONNECT	STD	{ int linux_connect(l_int s, l_uintptr_t name, \
+				    l_int namelen); }
+363	AUE_LISTEN	STD	{ int linux_listen(l_int s, l_int backlog); }
+364	AUE_ACCEPT	STD	{ int linux_accept4(l_int s, l_uintptr_t addr, \
+				    l_uintptr_t namelen, l_int flags); }
+365	AUE_GETSOCKOPT	STD	{ int linux_getsockopt(l_int s, l_int level, \
+				    l_int optname, l_uintptr_t optval, \
+				    l_uintptr_t optlen); }
+366	AUE_SETSOCKOPT	STD	{ int linux_setsockopt(l_int s, l_int level, \
+				    l_int optname, l_uintptr_t optval, \
+				    l_int optlen); }
+367	AUE_GETSOCKNAME	STD	{ int linux_getsockname(l_int s, \
+				    l_uintptr_t addr, l_uintptr_t namelen); }
+368	AUE_GETPEERNAME	STD	{ int linux_getpeername(l_int s, \
+				    l_uintptr_t addr, l_uintptr_t namelen); }
+369	AUE_SENDTO	STD	{ int linux_sendto(l_int s, l_uintptr_t msg, \
+				    l_int len, l_int flags, l_uintptr_t to, \
+				    l_int tolen); }
+370	AUE_SENDMSG	STD	{ int linux_sendmsg(l_int s, l_uintptr_t msg, \
+				    l_int flags); }
+371	AUE_RECVFROM	STD	{ int linux_recvfrom(l_int s, l_uintptr_t buf, \
+				    l_size_t len, l_int flags, l_uintptr_t from, \
+				    l_uintptr_t fromlen); }
+372	AUE_RECVMSG	STD	{ int linux_recvmsg(l_int s, l_uintptr_t msg, \
+				    l_int flags); }
+373	AUE_NULL	STD	{ int linux_shutdown(l_int s, l_int how); }
+;
+; linux 4.2:
+374	AUE_NULL	STD	{ int linux_userfaultfd(l_int flags); }
+; linux 4.3:
+375	AUE_NULL	STD	{ int linux_membarrier(l_int cmd, l_int flags); }
+; linux 4.4:
+376	AUE_NULL	STD	{ int linux_mlock2(l_ulong start, l_size_t len,	\
+				    l_int flags); }
+; linux 4.5:
+377	AUE_NULL	STD	{ int linux_copy_file_range(l_int fd_in,	\
+				    l_loff_t *off_in, l_int fd_out,		\
+				    l_loff_t *off_out, l_size_t len,		\
+				    l_uint flags); }
+; linux 4.6:
+378	AUE_NULL	STD	{ int linux_preadv2(l_ulong fd,			\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+379	AUE_NULL	STD	{ int linux_pwritev2(l_ulong fd,		\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+; linux 4.8:
+380	AUE_NULL	STD	{ int linux_pkey_mprotect(l_ulong start,	\
+				    l_size_t len, l_ulong prot, l_int pkey); }
+381	AUE_NULL	STD	{ int linux_pkey_alloc(l_ulong flags,		\
+				    l_ulong init_val); }
+382	AUE_NULL	STD	{ int linux_pkey_free(l_int pkey); }
+
 ; please, keep this line at the end.
-349	AUE_NULL	UNIMPL	nosys
+383	AUE_NULL	UNIMPL	nosys

Modified: head/sys/compat/linux/linux_socket.h
==============================================================================
--- head/sys/compat/linux/linux_socket.h	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/compat/linux/linux_socket.h	Sun Feb  5 14:17:09 2017	(r313284)
@@ -142,131 +142,18 @@ struct l_ucred {
 
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 
-struct linux_sendto_args {
-	int s;
-	l_uintptr_t msg;
-	int len;
-	int flags;
-	l_uintptr_t to;
-	int tolen;
-};
-
-struct linux_socket_args {
-	int domain;
-	int type;
-	int protocol;
-};
-
-struct linux_bind_args {
-	int s;
-	l_uintptr_t name;
-	int namelen;
-};
-
-struct linux_connect_args {
-	int s;
-	l_uintptr_t name;
-	int namelen;
-};
-
-struct linux_listen_args {
-	int s;
-	int backlog;
-};
-
 struct linux_accept_args {
 	int s;
 	l_uintptr_t addr;
 	l_uintptr_t namelen;
 };
 
-struct linux_accept4_args {
-	int s;
-	l_uintptr_t addr;
-	l_uintptr_t namelen;
-	int flags;
-};
-
-struct linux_getsockname_args {
-	int s;
-	l_uintptr_t addr;
-	l_uintptr_t namelen;
-};
-
-struct linux_getpeername_args {
-	int s;
-	l_uintptr_t addr;
-	l_uintptr_t namelen;
-};
-
-struct linux_socketpair_args {
-	int domain;
-	int type;
-	int protocol;
-	l_uintptr_t rsv;
-};
-
-struct linux_recvfrom_args {
-	int s;
-	l_uintptr_t buf;
-	int len;
-	int flags;
-	l_uintptr_t from;
-	l_uintptr_t fromlen;
-};
-
-struct linux_sendmsg_args {
-	int s;
-	l_uintptr_t msg;
-	int flags;
-};
-
-struct linux_recvmsg_args {
-	int s;
-	l_uintptr_t msg;
-	int flags;
-};
-
-struct linux_shutdown_args {
-	int s;
-	int how;
-};
-
-struct linux_setsockopt_args {
-	int s;
-	int level;
-	int optname;
-	l_uintptr_t optval;
-	int optlen;
-};
-
-struct linux_getsockopt_args {
-	int s;
-	int level;
-	int optname;
-	l_uintptr_t optval;
-	l_uintptr_t optlen;
-};
-
-int linux_socket(struct thread *td, struct linux_socket_args *args);
-int linux_bind(struct thread *td, struct linux_bind_args *args);
-int linux_connect(struct thread *, struct linux_connect_args *);
-int linux_listen(struct thread *td, struct linux_listen_args *args);
 int linux_accept(struct thread *td, struct linux_accept_args *args);
-int linux_accept4(struct thread *td, struct linux_accept4_args *args);
-int linux_getsockname(struct thread *td, struct linux_getsockname_args *args);
-int linux_getpeername(struct thread *td, struct linux_getpeername_args *args);
-int linux_socketpair(struct thread *td, struct linux_socketpair_args *args);
-int linux_sendto(struct thread *td, struct linux_sendto_args *args);
-int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args);
-int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args);
-int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args);
-int linux_shutdown(struct thread *td, struct linux_shutdown_args *args);
-int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args);
-int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args);
 
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
+
+
 /* Operations for socketcall */
 
 #define	LINUX_SOCKET 		1

Modified: head/sys/i386/linux/linux_dummy.c
==============================================================================
--- head/sys/i386/linux/linux_dummy.c	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/i386/linux/linux_dummy.c	Sun Feb  5 14:17:09 2017	(r313284)
@@ -109,19 +109,52 @@ DUMMY(inotify_init1);
 /* linux 2.6.30: */
 DUMMY(preadv);
 DUMMY(pwritev);
-/* linux 2.6.31 */
-DUMMY(rt_tsigqueueinfo);
+/* linux 2.6.31: */
+DUMMY(rt_tgsigqueueinfo);
 DUMMY(perf_event_open);
 /* linux 2.6.33: */
 DUMMY(fanotify_init);
 DUMMY(fanotify_mark);
-/* later: */
+/* linux 2.6.39: */
 DUMMY(name_to_handle_at);
 DUMMY(open_by_handle_at);
 DUMMY(clock_adjtime);
+/* linux 3.0: */
 DUMMY(setns);
+/* linux 3.2: */
 DUMMY(process_vm_readv);
 DUMMY(process_vm_writev);
+/* linux 3.5: */
+DUMMY(kcmp);
+/* linux 3.8: */
+DUMMY(finit_module);
+DUMMY(sched_setattr);
+DUMMY(sched_getattr);
+/* linux 3.14: */
+DUMMY(renameat2);
+/* linux 3.15: */
+DUMMY(seccomp);
+DUMMY(getrandom);
+DUMMY(memfd_create);
+/* linux 3.18: */
+DUMMY(bpf);
+/* linux 3.19: */
+DUMMY(execveat);
+/* linux 4.2: */
+DUMMY(userfaultfd);
+/* linux 4.3: */
+DUMMY(membarrier);
+/* linux 4.4: */
+DUMMY(mlock2);
+/* linux 4.5: */
+DUMMY(copy_file_range);
+/* linux 4.6: */
+DUMMY(preadv2);
+DUMMY(pwritev2);
+/* linux 4.8: */
+DUMMY(pkey_mprotect);
+DUMMY(pkey_alloc);
+DUMMY(pkey_free);
 
 #define DUMMY_XATTR(s)						\
 int								\

Modified: head/sys/i386/linux/syscalls.master
==============================================================================
--- head/sys/i386/linux/syscalls.master	Sun Feb  5 14:03:25 2017	(r313283)
+++ head/sys/i386/linux/syscalls.master	Sun Feb  5 14:17:09 2017	(r313284)
@@ -11,18 +11,20 @@
 ;		there is no audit event for the call at this time. For the
 ;		case where the event exists, but we don't want auditing, the
 ;		event should be #defined to AUE_NULL in audit_kevents.h.
-;	type	one of STD, OBSOL, UNIMPL
+;	type	one of STD, NOPROTO, UNIMPL
 ;	name	psuedo-prototype of syscall routine
 ;		If one of the following alts is different, then all appear:
 ;	altname	name of system call if different
 ;	alttag	name of args struct tag if different from [o]`name'"_args"
 ;	altrtyp	return type if not int (bogus - syscalls always return int)
-;		for UNIMPL/OBSOL, name continues with comments
+;		for UNIMPL, name continues with comments
 
 ; types:
 ;	STD	always included
-;	OBSOL	obsolete, not included in system, only specifies name
 ;	UNIMPL	not implemented, placeholder only
+;	NOPROTO same as STD except do not create structure or
+;		function prototype in sys/sysproto.h.  Does add a
+;		definition to syscall.h besides adding a sysent.
 
 #include <sys/param.h>
 #include <sys/sysent.h>
@@ -561,10 +563,15 @@
 331	AUE_NULL	STD	{ int linux_pipe2(l_int *pipefds, l_int flags); }
 332	AUE_NULL	STD	{ int linux_inotify_init1(void); }
 ; linux 2.6.30:
-333	AUE_NULL	STD	{ int linux_preadv(void); }
-334	AUE_NULL	STD	{ int linux_pwritev(void); }
+333	AUE_NULL	STD	{ int linux_preadv(l_ulong fd, 			\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
+334	AUE_NULL	STD	{ int linux_pwritev(l_ulong fd, 		\
+				    struct iovec *vec, l_ulong vlen,		\
+				    l_ulong pos_l, l_ulong pos_h); }
 ; linux 2.6.31:
-335	AUE_NULL	STD	{ int linux_rt_tsigqueueinfo(void); }
+335	AUE_NULL	STD	{ int linux_rt_tgsigqueueinfo(l_pid_t tgid,	\
+				    l_pid_t tid, l_int sig, l_siginfo_t *uinfo); }
 336	AUE_NULL	STD	{ int linux_perf_event_open(void); }
 ; linux 2.6.33:
 337	AUE_NULL	STD	{ int linux_recvmmsg(l_int s,			\
@@ -577,16 +584,112 @@
 				    l_uint resource,			\
 				    struct rlimit *new,			\
 				    struct rlimit *old); }
-; later:
+; linux 2.6.39:
 341	AUE_NULL	STD	{ int linux_name_to_handle_at(void); }
 342	AUE_NULL	STD	{ int linux_open_by_handle_at(void); }
 343	AUE_NULL	STD	{ int linux_clock_adjtime(void); }
 344	AUE_SYNC	STD	{ int linux_syncfs(l_int fd); }
+; linux 3.0:
 345	AUE_NULL	STD	{ int linux_sendmmsg(l_int s,			\
 				    struct l_mmsghdr *msg, l_uint vlen,		\
 				    l_uint flags); }
 346	AUE_NULL	STD	{ int linux_setns(void); }
-347	AUE_NULL	STD	{ int linux_process_vm_readv(void); }
-348	AUE_NULL	STD	{ int linux_process_vm_writev(void); }
+; linux 3.2 (glibc 2.15):
+347	AUE_NULL	STD	{ int linux_process_vm_readv(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+348	AUE_NULL	STD	{ int linux_process_vm_writev(l_pid_t pid,	\
+				    const struct iovec *lvec, l_ulong liovcnt,	\
+				    const struct iovec *rvec, l_ulong riovcnt,	\
+				    l_ulong flags); }
+; linux 3.5 (no glibc wrapper):
+349	AUE_NULL	STD	{ int linux_kcmp(l_pid_t pid1, l_pid_t pid2,	\
+				    l_int type, l_ulong idx1, l_ulong idx); }
+; linux 3.8 (no glibc wrapper):
+350	AUE_NULL	STD	{ int linux_finit_module(l_int fd,		\
+				    const char *uargs, l_int flags); }
+; linux 3.14:
+351	AUE_NULL	STD	{ int linux_sched_setattr(l_pid_t pid,		\
+				    void *attr, l_uint flags); }
+352	AUE_NULL	STD	{ int linux_sched_getattr(l_pid_t pid,		\
+				    void *attr, l_uint size, l_uint flags); }
+; linux 3.15:
+353	AUE_NULL	STD	{ int linux_renameat2(l_int oldfd,		\
+				    const char *oldname, l_int newfd, 		\
+				    const char *newname, unsigned int flags); }
+; linux 3.17:
+354	AUE_NULL	STD	{ int linux_seccomp(l_uint op, l_uint flags,	\
+				    const char *uargs); }
+355	AUE_NULL	STD	{ int linux_getrandom(char *buf,		\
+				    l_size_t count, l_uint flags); }
+356	AUE_NULL	STD	{ int linux_memfd_create(const char *uname_ptr,	\
+				    l_uint flags); }
+; linux 3.18:
+357	AUE_NULL	STD	{ int linux_bpf(l_int cmd, void *attr,		\
+				    l_uint size); }
+; linux 3.19:
+358	AUE_NULL	STD	{ int linux_execveat(l_int dfd,			\
+				    const char *filename, const char **argv,	\
+				    const char **envp, l_int flags); }
+; linux 4.3: sockets now direct system calls:
+359	AUE_SOCKET	STD	{ int linux_socket(l_int domain, l_int type, \
+				    l_int protocol); }
+360	AUE_SOCKETPAIR	STD	{ int linux_socketpair(l_int domain, \
+				    l_int type, l_int protocol, l_uintptr_t rsv); }
+361	AUE_BIND	STD	{ int linux_bind(l_int s, l_uintptr_t name, \
+				    l_int namelen); }
+362	AUE_CONNECT	STD	{ int linux_connect(l_int s, l_uintptr_t name, \
+				    l_int namelen); }
+363	AUE_LISTEN	STD	{ int linux_listen(l_int s, l_int backlog); }
+364	AUE_ACCEPT	STD	{ int linux_accept4(l_int s, l_uintptr_t addr, \
+				    l_uintptr_t namelen, l_int flags); }
+365	AUE_GETSOCKOPT	STD	{ int linux_getsockopt(l_int s, l_int level, \
+				    l_int optname, l_uintptr_t optval, \
+				    l_uintptr_t optlen); }
+366	AUE_SETSOCKOPT	STD	{ int linux_setsockopt(l_int s, l_int level, \
+				    l_int optname, l_uintptr_t optval, \
+				    l_int optlen); }
+367	AUE_GETSOCKNAME	STD	{ int linux_getsockname(l_int s, \
+				    l_uintptr_t addr, l_uintptr_t namelen); }
+368	AUE_GETPEERNAME	STD	{ int linux_getpeername(l_int s, \
+				    l_uintptr_t addr, l_uintptr_t namelen); }
+369	AUE_SENDTO	STD	{ int linux_sendto(l_int s, l_uintptr_t msg, \
+				    l_int len, l_int flags, l_uintptr_t to, \
+				    l_int tolen); }
+370	AUE_SENDMSG	STD	{ int linux_sendmsg(l_int s, l_uintptr_t msg, \
+				    l_int flags); }
+371	AUE_RECVFROM	STD	{ int linux_recvfrom(l_int s, l_uintptr_t buf, \
+				    l_size_t len, l_int flags, l_uintptr_t from, \
+				    l_uintptr_t fromlen); }
+372	AUE_RECVMSG	STD	{ int linux_recvmsg(l_int s, l_uintptr_t msg, \
+				    l_int flags); }
+373	AUE_NULL	STD	{ int linux_shutdown(l_int s, l_int how); }
+; linux 4.2:
+374	AUE_NULL	STD	{ int linux_userfaultfd(l_int flags); }
+; linux 4.3:
+375	AUE_NULL	STD	{ int linux_membarrier(l_int cmd, l_int flags); }
+; linux 4.4:
+376	AUE_NULL	STD	{ int linux_mlock2(l_ulong start, l_size_t len,	\
+				    l_int flags); }
+; linux 4.5:
+377	AUE_NULL	STD	{ int linux_copy_file_range(l_int fd_in,	\
+				    l_loff_t *off_in, l_int fd_out,		\
+				    l_loff_t *off_out, l_size_t len,		\
+				    l_uint flags); }
+; linux 4.6:
+378	AUE_NULL	STD	{ int linux_preadv2(l_ulong fd,			\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+379	AUE_NULL	STD	{ int linux_pwritev2(l_ulong fd,		\
+				    const struct iovec *vec, l_ulong vlen,	\
+				    l_ulong pos_l, l_ulong pos_h, l_int flags); }
+; linux 4.8:
+380	AUE_NULL	STD	{ int linux_pkey_mprotect(l_ulong start,	\
+				    l_size_t len, l_ulong prot, l_int pkey); }
+381	AUE_NULL	STD	{ int linux_pkey_alloc(l_ulong flags,		\
+				    l_ulong init_val); }
+382	AUE_NULL	STD	{ int linux_pkey_free(l_int pkey); }
+
 ; please, keep this line at the end.
-349	AUE_NULL	UNIMPL	nosys
+383	AUE_NULL	UNIMPL	nosys


More information about the svn-src-all mailing list