From owner-freebsd-threads@FreeBSD.ORG Wed Sep 8 17:56:11 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F9A71065672; Wed, 8 Sep 2010 17:56:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 065338FC12; Wed, 8 Sep 2010 17:56:11 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id DC8CE35A838; Wed, 8 Sep 2010 19:56:09 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id D0DBB17248; Wed, 8 Sep 2010 19:56:09 +0200 (CEST) Date: Wed, 8 Sep 2010 19:56:09 +0200 From: Jilles Tjoelker To: David Xu Message-ID: <20100908175609.GA30144@stack.nl> References: <20100906220041.GA4729@stack.nl> <4C86787E.6070908@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C86787E.6070908@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-threads@freebsd.org Subject: Re: sigwait() cancellation point X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 17:56:11 -0000 On Tue, Sep 07, 2010 at 05:38:06PM +0000, David Xu wrote: > Jilles Tjoelker wrote: > > Our sigwait() implementation may not be POSIX-compliant as it returns > > EINTR when it is interrupted by a caught signal. (Unfortunately I can > > only find this in SUSv4 in the Rationale, B.2.3 Error Numbers, > > Disallowing Return of the [EINTR] Error Code; the sigwait() page in XSH > > does not list an [EINTR] error condition, but does not prohibit one > > either like pthread_mutex_lock() and various others do.) > A system call can not return EINTR is not flexible, I think why don't > we fix it in libc and libthr, but let kernel returns EINTR? > I have worked out a patch: > http://people.freebsd.org/~davidxu/patch/sigwait.diff The idea and patch seem sensible. Some man page changes seem in order though: sigwaitinfo.2 should mention this difference between sigwait() and sigwaitinfo() more explicitly. -- Jilles Tjoelker