From patchwork Thu Jul 13 20:54:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 787985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x7p2w2ppQz9s7m for ; Fri, 14 Jul 2017 06:54:16 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 55378CA8; Thu, 13 Jul 2017 20:54:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CD1E7CA2 for ; Thu, 13 Jul 2017 20:54:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.cloudbasesolutions.com (mail.cloudbasesolutions.com [91.232.152.5]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 3D670FC for ; Thu, 13 Jul 2017 20:54:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.cloudbasesolutions.com (Postfix) with ESMTP id 4450F43EFD for ; Thu, 13 Jul 2017 23:54:10 +0300 (EEST) X-Virus-Scanned: amavisd-new at cloudbasesolutions.com Received: from mail.cloudbasesolutions.com ([127.0.0.1]) by localhost (mail.cloudbasesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SYz_CJ4WEhsn for ; Thu, 13 Jul 2017 23:54:09 +0300 (EEST) Received: from mail.cloudbasesolutions.com (unknown [10.77.78.3]) by mail.cloudbasesolutions.com (Postfix) with ESMTP id ED4AA414A6 for ; Thu, 13 Jul 2017 23:54:09 +0300 (EEST) Received: from CBSEX1.cloudbase.local ([10.77.78.3]) by CBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0361.001; Thu, 13 Jul 2017 22:54:09 +0200 From: Alin Serdean To: "dev@openvswitch.org" Thread-Topic: [PATCH] socket-util: Avoid using sendmsg on Windows Thread-Index: AQHS/BosfCyENdG3NUiNF/A1jWIu9w== Date: Thu, 13 Jul 2017 20:54:08 +0000 Message-ID: <20170713205348.6736-1-aserdean@cloudbasesolutions.com> Accept-Language: en-US, it-IT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.78.1] MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] socket-util: Avoid using sendmsg on Windows X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Sendmsg is not used under Windows. While it does have a sort of equivalent called `WSASendMsg` (https://msdn.microsoft.com/en-us/library/windows/desktop/ms741692(v=vs.85).aspx) it uses a different structure `WSAMSG` instead of the normal msghdr which in turn will have to be mapped properly (this goes further to iovec/wsabuf in the structure itself). Fixes broken build on Windows. Signed-off-by: Alin Gabriel Serdean --- lib/socket-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/socket-util.c b/lib/socket-util.c index 7148ae3..de7df67 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -1021,6 +1021,7 @@ sock_strerror(int error) #endif } +#ifndef _WIN32 //Avoid using sendmsg on Windows entirely static int emulate_sendmmsg(int fd, struct mmsghdr *msgs, unsigned int n, unsigned int flags) @@ -1058,3 +1059,4 @@ wrap_sendmmsg(int fd, struct mmsghdr *msgs, unsigned int n, unsigned int flags) return emulate_sendmmsg(fd, msgs, n, flags); } #endif +#endif