From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6F3B520248 for ; Sat, 16 Mar 2019 18:43:49 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=nrP i4nfYYC/xDqtFeLfQz3p0upDw/lhg1G3u8aEkKCEUeNoZUZFQONumc0nimWWpzUK VGFhlKrWk+iLeSoSVhGh1zkPuSvT2CQ++AWbIqFZfzSNdRBALKfnMgdrvL/wjnuv aYAWcHFVimddvahxVyyDjfZ7hfQk+XZJUOlV0b3s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=Z9EKA066u viCGnfBrw0E38jZHoE=; b=MHVXywPiE5158yepEZshcc7MCZ5ICKsvzIS+XW2qI VcGBmtu8rvBsVsqM0CBjFpuEjzFK6I01pDeHFSvlUh7wZquVvNeGH6rC6is6mcUR Zx39VM/DgEW8mty1G5VyD1NteNgs3Qe6tYGlOOQzqWmZLBnYyBJisAD+V8M7Dab+ 1Q= Received: (qmail 62983 invoked by alias); 16 Mar 2019 18:43:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 62973 invoked by uid 89); 16 Mar 2019 18:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Document how EINTR should be handled in critical sections Date: Sat, 16 Mar 2019 19:43:36 +0100 Message-Id: <20190316184336.11038-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit * hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR should be handled. --- ChangeLog | 5 +++++ hurd/hurd/signal.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3d2bdc8143..ce14d885b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-03-16 Samuel Thibault + + * hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR + should be handled. + 2019-03-15 Joseph Myers * sysdeps/unix/sysv/linux/syscall-names.list: Update kernel diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index c30f536436..b0b53668d2 100644 --- a/hurd/hurd/signal.h +++ b/hurd/hurd/signal.h @@ -168,7 +168,13 @@ extern int _hurd_core_limit; A critical section is a section of code which cannot safely be interrupted to run a signal handler; for example, code that holds any lock cannot be interrupted lest the signal handler try to take the same lock and - deadlock result. */ + deadlock result. + + As a consequence, a critical section will see its RPCs return EINTR, even if + SA_RESTART is set! In that case, the critical section should be left, so + that the handler can run, and the whole critical section be tried again, to + avoid unexpectingly exposing EINTR to the application. + */ extern void *_hurd_critical_section_lock (void); -- 2.20.1