From owner-freebsd-net@freebsd.org Mon Jan 4 10:17:54 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1DB6A60AA9 for ; Mon, 4 Jan 2016 10:17:54 +0000 (UTC) (envelope-from c2h@romeo.emu.st) Received: from f5.bushwire.net (f5.bushwire.net [IPv6:2607:fc50:1000:5b00::2]) by mx1.freebsd.org (Postfix) with ESMTP id D8A10128F for ; Mon, 4 Jan 2016 10:17:54 +0000 (UTC) (envelope-from c2h@romeo.emu.st) Received: by f5.bushwire.net (Postfix, from userid 1001) id EF645AC908; Mon, 4 Jan 2016 02:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d=emu.st; s=2015; t=1451902667; bh=gKw6zpszs2hIVvjBheQb2A2TyDI=; h=Comments:Received:Date:Message-ID:From:To:Subject:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=V0/I1aEj6SFFDacgnss292EPBRxHOGeXA8vaEV6/LwxnPJb9/U3AQ5uwxoAhTYLTY mtkGbiPWYOqluxHa6y+++mwuqclEhq/aAzwNrLC7B4fLHvLjvBi6t3DiVMZsCZXXeL AbPjJ74aHXSuTjRQTyUiNrwj5mSecb7cc64GqMos=GqMos= Comments: QMDA 0.3 Received: (qmail 58348 invoked by uid 1001); 4 Jan 2016 10:17:47 -0000 Date: 4 Jan 2016 10:17:47 +0000 Message-ID: <20160104101747.58347.qmail@f5-external.bushwire.net> From: "Mark Delany" To: freebsd-net@freebsd.org Subject: Re: Does FreeBSD have sendmmsg or recvmmsg system calls? References: <1451841004.10139.34.camel@me.com> <20160103214720.72014.qmail@f5-external.bushwire.net> <20160104085415.GS3625@kib.kiev.ua> <20160104091108.50654.qmail@f5-external.bushwire.net> <20160104093859.GV3625@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160104093859.GV3625@kib.kiev.ua> X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 10:17:55 -0000 > Why is a signal lost in the scenario you described ? Because the return can only indicate a signal/error *or* a batch of messages but not both and the semantics of recvmsg() means that both could occur. Don't just consider signals, consider any -1/errno return from recvmsg() such as -1/EAGAIN or -1/ENOBUFS or -1/EFAULT. If one emulates recvmmsg() via multiple calls to recvmsg() and the emulation receives 'n' messages via recvmsg() then gets a -1/EFAULT return on message 'n'+1 then what does it return to the caller? If it returns 'n' messages then the EFAULT is lost. If it returns -1/EFAULT then the 'n' messages are lost. Mark.