Module Name: src
Committed By: christos
Date: Fri Feb 3 13:08:08 UTC 2017
Modified Files:
src/sys/compat/linux/common: linux_socket.c linux_socketcall.c
linux_socketcall.h
Log Message:
handle accept4 for i386
To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/linux/common/linux_socketcall.c
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux/common/linux_socketcall.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.135 src/sys/compat/linux/common/linux_socket.c:1.136
--- src/sys/compat/linux/common/linux_socket.c:1.135 Fri Feb 3 03:43:02 2017
+++ src/sys/compat/linux/common/linux_socket.c Fri Feb 3 08:08:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.135 2017/02/03 08:43:02 martin Exp $ */
+/* $NetBSD: linux_socket.c,v 1.136 2017/02/03 13:08:08 christos Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.135 2017/02/03 08:43:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.136 2017/02/03 13:08:08 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -1708,7 +1708,6 @@ linux_sys_accept(struct lwp *l, const st
return (0);
}
-#ifndef __i386__ /* Linux/i386 does not have this syscall */
int
linux_sys_accept4(struct lwp *l, const struct linux_sys_accept4_args *uap, register_t *retval)
{
@@ -1743,5 +1742,3 @@ linux_sys_accept4(struct lwp *l, const s
return 0;
}
-#endif
-
Index: src/sys/compat/linux/common/linux_socketcall.c
diff -u src/sys/compat/linux/common/linux_socketcall.c:1.45 src/sys/compat/linux/common/linux_socketcall.c:1.46
--- src/sys/compat/linux/common/linux_socketcall.c:1.45 Sun Nov 9 12:48:08 2014
+++ src/sys/compat/linux/common/linux_socketcall.c Fri Feb 3 08:08:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socketcall.c,v 1.45 2014/11/09 17:48:08 maxv Exp $ */
+/* $NetBSD: linux_socketcall.c,v 1.46 2017/02/03 13:08:08 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.45 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.46 2017/02/03 13:08:08 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -107,6 +107,7 @@ static const struct {
{L("getsockopt"),sizeof(struct linux_sys_getsockopt_args)}, /* 15 */
{L("sendmsg"), sizeof(struct linux_sys_sendmsg_args)}, /* 16 */
{L("recvmsg"), sizeof(struct linux_sys_recvmsg_args)}, /* 17 */
+ {L("accept4"), sizeof(struct linux_sys_accept4_args)}, /* 18 */
#undef L
};
@@ -215,6 +216,9 @@ linux_sys_socketcall(struct lwp *l, cons
case LINUX_SYS_RECVMSG:
error = linux_sys_recvmsg(l, (void *)&lda, retval);
break;
+ case LINUX_SYS_ACCEPT4:
+ error = linux_sys_accept4(l, (void *)&lda, retval);
+ break;
default:
error = ENOSYS;
break;
Index: src/sys/compat/linux/common/linux_socketcall.h
diff -u src/sys/compat/linux/common/linux_socketcall.h:1.17 src/sys/compat/linux/common/linux_socketcall.h:1.18
--- src/sys/compat/linux/common/linux_socketcall.h:1.17 Fri Dec 27 10:10:53 2013
+++ src/sys/compat/linux/common/linux_socketcall.h Fri Feb 3 08:08:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socketcall.h,v 1.17 2013/12/27 15:10:53 njoly Exp $ */
+/* $NetBSD: linux_socketcall.h,v 1.18 2017/02/03 13:08:08 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -91,8 +91,11 @@
#define LINUX_SYS_GETSOCKOPT 15
#define LINUX_SYS_SENDMSG 16
#define LINUX_SYS_RECVMSG 17
+#define LINUX_SYS_ACCEPT4 18
+#define LINUX_SYS_RECVMMSG 19
+#define LINUX_SYS_SENDMMSG 20
-#define LINUX_MAX_SOCKETCALL 17
+#define LINUX_MAX_SOCKETCALL 18 /* no send/recv mmsg yet */
/*
@@ -221,6 +224,13 @@ struct linux_sys_shutdown_args {
syscallarg(int) how;
};
+struct linux_sys_accept4_args {
+ syscallarg(int) s;
+ syscallarg(struct osockaddr *) name;
+ syscallarg(int *) anamelen;
+ syscallarg(int) flags;
+};
+
# ifdef _KERNEL
__BEGIN_DECLS
#define SYS_DEF(foo) int foo(struct lwp *, const struct foo##_args *, register_t *);
@@ -239,6 +249,7 @@ SYS_DEF(linux_sys_recvmsg)
SYS_DEF(linux_sys_recv)
SYS_DEF(linux_sys_send)
SYS_DEF(linux_sys_accept)
+SYS_DEF(linux_sys_accept4)
#undef SYS_DEF
__END_DECLS
# endif /* !_KERNEL */