From patchwork Sat Mar 16 18:43:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1057398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100676-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="THCa+G6+"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 44MBDT5w5hz9ryj for ; Sun, 17 Mar 2019 05:43:53 +1100 (AEDT) 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=vzW PtRReGf1MBxhH1Sxf0oZerZkoESgYtagbkeOZeDNAFdWii/aTTjbnlMdNiGkQnSO UXwv07BFfZKafLiS/xbG+b+FZsys/XgAw94ren6Iad+7XNsqBLEOWDZPBisrBNUO Mw5JBjUQb63t/z07LaJ708WSqZP/eOy35fAYy/zU= 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=THCa+G6+H2AFBlDDFfuvErfKVzMBKC+hA8tBNPUAh K6ls1WV2SIOAGnl1YGx6FmfrkLMKf7kwZ+Ll/CBUzqtGV1zIeyMMcb0JeP22E/uz SwA3z/HZElWSQYPKpozIFbAAHl+ManvTBTVg4XYl6Q1A7ItlJdYv9SHWFWGhrvmH MI= 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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 62973 invoked by uid 89); 16 Mar 2019 18:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=samuel, Samuel, 168, 7, 1687 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 * 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);