From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:48:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796EE1065673; Mon, 1 Jun 2009 20:48:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCCA8FC15; Mon, 1 Jun 2009 20:48:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n51Kme8Z091491; Mon, 1 Jun 2009 20:48:40 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n51KmeAi091488; Mon, 1 Jun 2009 20:48:40 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906012048.n51KmeAi091488@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 1 Jun 2009 20:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193264 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 20:48:40 -0000 Author: dchagin Date: Mon Jun 1 20:48:39 2009 New Revision: 193264 URL: http://svn.freebsd.org/changeset/base/193264 Log: Implement accept4 syscall. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_socket.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/amd64/linux32/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -669,6 +669,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:48:39 2009 (r193264) @@ -825,6 +825,21 @@ linux_accept(struct thread *td, struct l args->namelen)); } +struct linux_accept4_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; + int flags; +}; + +static int +linux_accept4(struct thread *td, struct linux_accept4_args *args) +{ + + return (linux_accept_common(td, args->s, args->addr, + args->namelen, args->flags)); +} + struct linux_getsockname_args { int s; l_uintptr_t addr; @@ -1528,7 +1543,8 @@ static const unsigned char lxs_args[] = LINUX_AL(4) /* recv */, LINUX_AL(6) /* sendto */, LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */, LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */, - LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */ + LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */, + LINUX_AL(4) /* accept4 */ }; #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 @@ -1582,6 +1598,8 @@ linux_socketcall(struct thread *td, stru return (linux_sendmsg(td, arg)); case LINUX_RECVMSG: return (linux_recvmsg(td, arg)); + case LINUX_ACCEPT4: + return (linux_accept4(td, arg)); } uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/i386/linux/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -645,6 +645,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0