From owner-freebsd-threads@FreeBSD.ORG Thu Sep 9 06:29:28 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 8455A10656BF for ; Thu, 9 Sep 2010 06:29:28 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5A15A8FC19; Thu, 9 Sep 2010 06:29:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o896TQPI081896; Thu, 9 Sep 2010 06:29:27 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4C88EF47.4010906@freebsd.org> Date: Thu, 09 Sep 2010 14:29:27 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: Jilles Tjoelker References: <20100906220041.GA4729@stack.nl> <4C86787E.6070908@freebsd.org> <20100908175609.GA30144@stack.nl> In-Reply-To: <20100908175609.GA30144@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Thu, 09 Sep 2010 06:29:28 -0000 Jilles Tjoelker wrote: > 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. > problem is I still want to know which OS does not return EINTR ? it seems I can not find one on net, so is it an accident of the specification group?