Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common handle accept4 for i386



details:   https://anonhg.NetBSD.org/src/rev/b0c08eaba34d
branches:  trunk
changeset: 821385:b0c08eaba34d
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 03 13:08:08 2017 +0000

description:
handle accept4 for i386

diffstat:

 sys/compat/linux/common/linux_socket.c     |   7 ++-----
 sys/compat/linux/common/linux_socketcall.c |   8 ++++++--
 sys/compat/linux/common/linux_socketcall.h |  15 +++++++++++++--
 3 files changed, 21 insertions(+), 9 deletions(-)

diffs (112 lines):

diff -r 518e3edb3027 -r b0c08eaba34d sys/compat/linux/common/linux_socket.c
--- a/sys/compat/linux/common/linux_socket.c    Fri Feb 03 08:43:02 2017 +0000
+++ b/sys/compat/linux/common/linux_socket.c    Fri Feb 03 13:08:08 2017 +0000
@@ -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 @@
        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 @@
 
        return 0;
 }
-#endif
-
diff -r 518e3edb3027 -r b0c08eaba34d sys/compat/linux/common/linux_socketcall.c
--- a/sys/compat/linux/common/linux_socketcall.c        Fri Feb 03 08:43:02 2017 +0000
+++ b/sys/compat/linux/common/linux_socketcall.c        Fri Feb 03 13:08:08 2017 +0000
@@ -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 @@
        {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 @@
        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;
diff -r 518e3edb3027 -r b0c08eaba34d sys/compat/linux/common/linux_socketcall.h
--- a/sys/compat/linux/common/linux_socketcall.h        Fri Feb 03 08:43:02 2017 +0000
+++ b/sys/compat/linux/common/linux_socketcall.h        Fri Feb 03 13:08:08 2017 +0000
@@ -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 @@
        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_recv)
 SYS_DEF(linux_sys_send)
 SYS_DEF(linux_sys_accept)
+SYS_DEF(linux_sys_accept4)
 #undef SYS_DEF
 __END_DECLS
 # endif /* !_KERNEL */



Home | Main Index | Thread Index | Old Index