From owner-freebsd-arch@FreeBSD.ORG Fri Apr 17 22:29:32 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 136766BD for ; Fri, 17 Apr 2015 22:29:32 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CF55587E for ; Fri, 17 Apr 2015 22:29:31 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E1FB2B80E8; Sat, 18 Apr 2015 00:29:27 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id CB8CD28494; Sat, 18 Apr 2015 00:29:27 +0200 (CEST) Date: Sat, 18 Apr 2015 00:29:27 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: arch@freebsd.org Subject: Re: Make ppoll(2) and waitid(2) cancellation points Message-ID: <20150417222927.GB34016@stack.nl> References: <20150417075933.GH2390@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150417075933.GH2390@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 22:29:32 -0000 On Fri, Apr 17, 2015 at 10:59:33AM +0300, Konstantin Belousov wrote: > Patch below makes ppoll(2) and waitid(2) cancellable. > The waitid(2) is required to be a cancellation point by POSIX, so the > change fixes a definite bug. It is done by making wait6() cancellable, > in line with the other wait*(2) syscalls. > For ppoll(2), our other select/poll interfaces are cancel points, i.e. > select, pselect, and poll. It is reasonable for ppoll() to follow the > suite. > The interposing table was extended at the end, instead of ordering new > interposers by alphabet. It would be acceptable, but makes it easier > for people to run new libc with older libthr (although not supported). lib/libc/gen/waitid.c needs to be adjusted to call __libc_interposing[INTERPOS_wait6] instead of _wait6 which is not a cancellation point. Please add comments about cancellation behaviour to lib/libthr/thread/thr_syscalls.c. You can just copy the comments from __thr_poll and __thr_wait4. Looks good otherwise. -- Jilles Tjoelker