From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) by sourceware.org (Postfix) with ESMTPS id C8D53396AC1A for ; Wed, 16 Jun 2021 17:01:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8D53396AC1A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from [192.168.1.104] ([68.147.0.90]) by shaw.ca with ESMTP id tYvAlPpcF7YjPtYvBlklaE; Wed, 16 Jun 2021 11:01:45 -0600 X-Authority-Analysis: v=2.4 cv=fPVaYbWe c=1 sm=1 tr=0 ts=60ca2e79 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=npldXguGAAAA:8 a=tSH-PNuA-LLXTNAVrNkA:9 a=QEXdDO2ut3YA:10 a=Z3hCQHVUXPYA:10 a=sdPHrHSwQQcA:10 a=1MEZn5qd6kv58cYvHi58:22 Reply-To: newlib@sourceware.org To: newlib@sourceware.org References: From: Brian Inglis Organization: Systematic Software Subject: Re: Does Cygwin have str2sig/sig2str? Message-ID: Date: Wed, 16 Jun 2021 11:01:44 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfM7tfFelCZLuTOuustPqTv08VpPXqXJq6zA21mDy6ura1xhu53ZbeHAEpS/zVrq2XFavIrsBSOaIBZKc95zZAfw8XtSug4MsowlwHbkq0/9LaMEIahth B34kcWexPAfCNQfvHgABR+5FF58XnBMNc1NjohVEMUiTrskPUOkocaJs3fo2C9ieY+F0gGb8BKQJ4+Lf8Q+6q/MEdUKgNsZZ3Lw= X-Spam-Status: No, score=-3488.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 17:01:48 -0000 On 2021-05-20 14:23, Joel Sherrill wrote: > On Thu, May 20, 2021, 2:54 PM Corinna Vinschen wrote: >> On May 20 09:58, Joel Sherrill wrote: >>> The next POSIX version is wrapping up and unless something >>> changes will be adding str2sig and sig2str. Does Cygwin have >>> those? >>> I'm asking to see if we adapt the Cygwin version for general use >>> or have to write it from scratch. >>> The glibc and Illumos implementations are what you would expect. >>> They just use an array of { signal, string_name} and a lookup >>> search. Something similar would be OK for newlib. >> I don't see glibc defining the above symbols in the master branch. > Hmm ... Maybe google found someone's branch. >> Cygwin exports two functions with equivalent functionality: >> char *strsignal (int signo); >> int strtosigno (const char *name); >> see the file winsup/cygwin/strsig.cc. > I think those are the bsd equivalents. Functions strsignal, psignal, and psiginfo are related current POSIX interfaces: there are POSIX man pages for all three, and newlib man pages for strsignal, psignal, but none for psiginfo, and no Cygwin man pages for psiginfo or strtosigno, although the latter is declared in string.h with strsignal, and psiginfo is declared in cygwin/signal.h; Cygwin also exports sys_siglist, which is no longer exported by glibc. > Would it be ok to generalize that and provide the new POSIX as well > as the BSD interfaces? See the POSIX proposal notes from kre for BSD interfaces which are different: signalname, signalnumber, signalnext https://www.austingroupbugs.net/view.php?id=1138 also notes on avoiding manifest constants and using sysconf interfaces, which may or may not affect the final specification. It also notes glibc added sigabbrev_np; glibc also added sigdescr_np, (and spurious mentions of sigdabbrev_np, which appears to be a thinko) and stopped exporting sys_siglist. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]