From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: newlib@sourceware.org
Subject: Re: Does Cygwin have str2sig/sig2str?
Date: Wed, 16 Jun 2021 11:01:44 -0600 [thread overview]
Message-ID: <f65360be-87f4-d414-c6f3-54dae26e2a02@SystematicSw.ab.ca> (raw)
In-Reply-To: <CAF9ehCXxcWH5tufO+m3Tu0pU8-FA3rf6DEPfDj19bD4MrBsO1A@mail.gmail.com>
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.]
prev parent reply other threads:[~2021-06-16 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 14:58 Joel Sherrill
2021-05-20 19:54 ` Corinna Vinschen
2021-05-20 20:23 ` Joel Sherrill
2021-05-25 13:11 ` Corinna Vinschen
2021-06-16 17:01 ` Brian Inglis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f65360be-87f4-d414-c6f3-54dae26e2a02@SystematicSw.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).