From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 4 06:45:59 2013 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B614F02; Mon, 4 Feb 2013 06:45:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 14984F8A; Mon, 4 Feb 2013 06:45:57 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r146juIv031266; Mon, 4 Feb 2013 17:45:56 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r146jejn002133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Feb 2013 17:45:42 +1100 Date: Mon, 4 Feb 2013 17:45:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: kern/175674: sem_open() should use O_EXLOCK with open() instead of a separate flock() call In-Reply-To: Message-ID: <20130204173830.K1078@besplex.bde.org> References: <201302032100.r13L01PG044439@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zty1sKHG c=1 sm=1 a=OaIvZTCE_5IA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=BVas654tiecA:10 a=6I5d2MoRAAAA:8 a=uZvujYp8AAAA:8 a=XzZWLXe3-GZ5s4uFJ2sA:9 a=CjuIK1q_8ugA:10 a=mcOWcEogsjYA:10 a=SV7veod9ZcQA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: freebsd-bugs@FreeBSD.org, Giorgos Keramidas , Jilles Tjoelker X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 06:45:59 -0000 On Sun, 3 Feb 2013, Eitan Adler wrote: > On 3 February 2013 16:00, Giorgos Keramidas wrote: >> The following reply was made to PR kern/175674; it has been noted by GNATS. >> > The best way to fix this is in kern_openat() in the kernel but this >> > might cause compatibility issues. >> >> Not sure if there would be serious compatibility problems if open() would >> automatically restart instead of returning EINTR. It definitely seems a rather >> intrusive change though. > > I can not see major application breakage should open(3) be changed. > > That said, I am confused by jilles' comment: > http://pubs.opengroup.org/onlinepubs/000095399/functions/open.html > open(3) is permitted to return EINTR. Actually, open(3) is _required_ to return EINTR (if a signal occurs). This hasn't changed since the old (2001) POSIX draft that I quoted in a more detailed reply. The wording is "shall fail...[with EINTR] if a signal was caught during open()". Only a perverse implementation of weaselnix would justify not returning EINTR by not catching signals. Bruce