From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 637 invoked by alias); 14 Jan 2019 20:29:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 626 invoked by uid 89); 14 Jan 2019 20:29:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt1-f175.google.com Return-Path: Subject: Re: Fwd: What can a signal handler do with SIGSTKSZ? To: Zack Weinberg , Adhemerval Zanella Cc: GNU C Library References: <874lafezhe.fsf@oldenburg2.str.redhat.com> <87sgxzdjl4.fsf@oldenburg2.str.redhat.com> <61925098-4669-b478-9baf-644818d26a44@arm.com> <32971978-77ca-57f4-2524-560f53008be4@linaro.org> From: Carlos O'Donell Openpgp: preference=signencrypt Message-ID: Date: Mon, 14 Jan 2019 20:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00306.txt.bz2 On 1/14/19 11:34 AM, Zack Weinberg wrote: > For this new interface, the backward compatibility concerns I raised > regarding what you can do in MINSIGSTKSZ don't necessarily apply, and > it would make sense for it to be truly a minimum. I would suggest we > define "minimum" in terms of what the C standard - not POSIX - allows > you to do in a signal handler, which is almost nothing: you're > guaranteed to have enough space in sysconf(_SC_MINSIGSTKSZ) for this: > > static volatile sig_atomic_t signal_flag = 0; > static void handler(int unused) > { > flag = 1; > } > > and this: > > static atomic_uint signal_count = 0; > static void handler (int unused) > { > atomic_fetch_add (&signal_count, 1); > } By my reading we'd also have to support: abort, _Exit, quick_exit, and signal. What I'm not quite sure about is that errno has visible changes from these functions, particularly signal failing and if we must also exercise writing to a TLS errno. -- Cheers, Carlos.