From patchwork Thu Dec 24 18:59:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Paul Adrian Glaubitz X-Patchwork-Id: 560979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B68E5140BFC for ; Fri, 25 Dec 2015 08:53:09 +1100 (AEDT) Received: from localhost ([::1]:33514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCDop-0002e6-N0 for incoming@patchwork.ozlabs.org; Thu, 24 Dec 2015 16:53:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCB7R-00036T-Fk for qemu-devel@nongnu.org; Thu, 24 Dec 2015 14:00:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCB7O-0002pw-GM for qemu-devel@nongnu.org; Thu, 24 Dec 2015 14:00:09 -0500 Received: from outpost19.zedat.fu-berlin.de ([130.133.4.112]:53926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCB7O-0002pB-9j for qemu-devel@nongnu.org; Thu, 24 Dec 2015 14:00:06 -0500 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtp (envelope-from ) id <1aCB7N-002QDz-ON>; Thu, 24 Dec 2015 20:00:05 +0100 Received: from z6.physik.fu-berlin.de ([160.45.34.66] helo=z6) by relay1.zedat.fu-berlin.de (Exim 4.85) with esmtps (envelope-from ) id <1aCB7N-0015jb-Mu>; Thu, 24 Dec 2015 20:00:05 +0100 Received: from glaubitz by z6 with local (Exim 4.86) (envelope-from ) id 1aCB7K-0001aV-DU; Thu, 24 Dec 2015 20:00:02 +0100 From: John Paul Adrian Glaubitz To: qemu-devel@nongnu.org Date: Thu, 24 Dec 2015 19:59:59 +0100 Message-Id: <1450983599-6060-2-git-send-email-glaubitz@physik.fu-berlin.de> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1450983599-6060-1-git-send-email-glaubitz@physik.fu-berlin.de> References: <1450983599-6060-1-git-send-email-glaubitz@physik.fu-berlin.de> X-Originating-IP: 160.45.34.66 X-ZEDAT-Hint: RV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 130.133.4.112 X-Mailman-Approved-At: Thu, 24 Dec 2015 16:52:45 -0500 Cc: laurent@vivier.eu, John Paul Adrian Glaubitz Subject: [Qemu-devel] [PATCH 2/2] linux-user: Add SOCKOP_sendmmsg and SOCKOP_recvmmsg socket call, wire them up. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: John Paul Adrian Glaubitz --- linux-user/syscall.c | 8 ++++++-- linux-user/syscall_defs.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6c64ba6..dd6ed47 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2171,7 +2171,6 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg, return ret; } -#ifdef TARGET_NR_sendmmsg /* We don't rely on the C library to have sendmmsg/recvmmsg support, * so it might not have this *mmsg-specific flag either. */ @@ -2218,7 +2217,6 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec, } return ret; } -#endif /* If we don't have a system accept4() then just call accept. * The callsites to do_accept4() will ensure that they don't @@ -2441,6 +2439,8 @@ static abi_long do_socketcall(int num, abi_ulong vptr) [SOCKOP_shutdown] = 2, /* sockfd, how */ [SOCKOP_sendmsg] = 3, /* sockfd, msg, flags */ [SOCKOP_recvmsg] = 3, /* sockfd, msg, flags */ + [SOCKOP_sendmmsg] = 4, /* sockfd, msgvec, vlen, flags */ + [SOCKOP_recvmmsg] = 4, /* sockfd, msgvec, vlen, flags */ [SOCKOP_setsockopt] = 5, /* sockfd, level, optname, optval, optlen */ [SOCKOP_getsockopt] = 5, /* sockfd, level, optname, optval, optlen */ }; @@ -2491,6 +2491,10 @@ static abi_long do_socketcall(int num, abi_ulong vptr) return do_sendrecvmsg(a[0], a[1], a[2], 1); case SOCKOP_recvmsg: /* sockfd, msg, flags */ return do_sendrecvmsg(a[0], a[1], a[2], 0); + case SOCKOP_sendmmsg: /* sockfd, msgvec, vlen, flags */ + return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 1); + case SOCKOP_recvmmsg: /* sockfd, msgvec, vlen, flags */ + return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 0); case SOCKOP_setsockopt: /* sockfd, level, optname, optval, optlen */ return do_setsockopt(a[0], a[1], a[2], a[3], a[4]); case SOCKOP_getsockopt: /* sockfd, level, optname, optval, optlen */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index f996acf..0d6d141 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -28,6 +28,8 @@ #define SOCKOP_sendmsg 16 #define SOCKOP_recvmsg 17 #define SOCKOP_accept4 18 +#define SOCKOP_recvmmsg 19 +#define SOCKOP_sendmmsg 20 #define IPCOP_semop 1 #define IPCOP_semget 2