From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933AbYIBH61 (ORCPT ); Tue, 2 Sep 2008 03:58:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752847AbYIBH6T (ORCPT ); Tue, 2 Sep 2008 03:58:19 -0400 Received: from ug-out-1314.google.com ([66.249.92.173]:60875 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbYIBH6S (ORCPT ); Tue, 2 Sep 2008 03:58:18 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:user-agent:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding:from; b=ejh1sTfRXiuVjrp8FZ73vQA9zAzl254TrpCnUVB/IdJtuw+2DDByMaMGjZ3BPB6bPo 2MgqUWVqICUhRBCQVOMVXR16o3UqjeJgn83oDs00c3mJocczJLdhOLtjBVdiEswTwveO 6v/IYCSieG97HxV5JKeZUmHQpWZCULKE8RxcM= Message-ID: <48BCF211.3050809@gmail.com> Date: Tue, 02 Sep 2008 09:58:09 +0200 User-Agent: Thunderbird 2.0.0.12 (X11/20071114) MIME-Version: 1.0 To: Ulrich Drepper CC: Michael Kerrisk , Ulrich Drepper , Davide Libenzi , lkml , Andrew Morton , Jakub Jelinek , Linus Torvalds Subject: Re: Rationale for paccept() sigset argument? References: <48AC4B44.2010606@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: Michael Kerrisk Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ulrich Drepper wrote: > On Wed, Aug 20, 2008 at 9:50 AM, Michael Kerrisk > wrote: >> What is the rationale for the sigset argument of paccept()? > > accept, like select/poll, is used often as a function to dealy > operation. Unlike read, recv, etc, which are handled using O_NONBLOCK > and select/poll. pselect/ppoll do not really have a sigset parameter > to handle signals in general. You use it to enable special handling > in case of blocking. Example: if you want to implement userlevel > context switching, you dedicate a signal to wake up any blocked > thread. Since accept falls more into the same category than poll, > this means the sigset parameter is justified. In theory we could add > it to all functions but there is no reason to do this without any > other reason to change the interface. Ulrich, you snipped a relevant piece of my earlier message: [[ > * It seems to me that any case where we might want to use paccept() could be > equivalently dealt with using the existing pselect()/ppoll()/epoll_pwait() > followed by a conventional accept() if the listening file descriptor > indicates as ready. ]] So I'll rephrase: what use case does the sigset argument of paccept() allow us to handle that couldn't equally have been handled by pselect()/ppoll()/epoll_pwait() + traditional accept()? Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html