From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PktmNDHL2GDcdgAAWB0awg (envelope-from ) for ; Sun, 27 Jun 2021 15:02:09 -0400 Received: by simark.ca (Postfix, from userid 112) id C86CB1F1F2; Sun, 27 Jun 2021 15:02:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 119351EE14 for ; Sun, 27 Jun 2021 15:02:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C295D383583B for ; Sun, 27 Jun 2021 19:02:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C295D383583B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624820528; bh=kRmaSvEKElUXE9FdjFCd2hdXEf7oBIS7MMbpYBmQvmA=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tjpojo3vYokPU1HpR62NGEZ/xRG5eoG1jNiSL9I6hmPLMmkwlynuxxF6uwS1jvlZY kfmZJlfVrds+0ZUAvsD0/ANtTmVwbQReHpMVbovnvWBjLEloJbXOSOhdPQoph9KQr/ Xz8/JVXL3xLIXH18t7guPfcO98YeNbj6h6yUTzNE= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id EA65D3858023 for ; Sun, 27 Jun 2021 19:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA65D3858023 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 15RJ1Wgc009590 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 27 Jun 2021 15:01:36 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 15RJ1Wgc009590 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E22BC1EE14; Sun, 27 Jun 2021 15:01:28 -0400 (EDT) Subject: Re: [PATCH 3/4] scoped_ignore_signal: Use sigprocmask+sigtimedwait instead of signal To: Pedro Alves , John Baldwin , gdb-patches@sourceware.org References: <20210615111429.1879286-1-pedro@palves.net> <20210615111429.1879286-4-pedro@palves.net> <6dca033a-1b6f-05df-8dd0-e1cc2c7d85d2@FreeBSD.org> <5f2c10b5-035f-b66d-77c0-c141cc0e9d0c@palves.net> Message-ID: Date: Sun, 27 Jun 2021 15:01:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5f2c10b5-035f-b66d-77c0-c141cc0e9d0c@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 27 Jun 2021 19:01:32 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Thanks, that looks right to me. We're using sigtimewait with zero timeout to consume > a pending signal. sigpending + sigwait effectively does the same thing. > > According to gnulib, sigpending exists everywhere but mingw: > > https://www.gnu.org/software/gnulib/manual/html_node/sigpending.html > > and sigtimedwait is missing on "Mac OS X 10.13, OpenBSD 6.7, Minix 3.1.8, Cygwin 2.9, mingw, MSVC 14, Android 5.1.": > > https://www.gnu.org/software/gnulib/manual/html_node/sigtimedwait.html > > So the approach you propose should work well. > > Given sigpending is everywhere Unix-like, if we'd like, we could instead use the sigpending + sigwait path > unconditionally everywhere, but that's two syscalls instead of one, and the configure check is > trivial (just add sigtimedwait to AC_CHECK_FUNCS in gdbsupport/common.m4), so why not indeed save one > syscall, seems easy enough. > > Let me know if you'd rather me do the leg work of writing the actual patch. Thanks, I'll do it since I have access to a macOS system, and therefore I can at least compile-test it. Simon