public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: Joel Sherrill <joel@rtems.org>
Cc: Newlib <newlib@sourceware.org>
Subject: Re: Does Cygwin have str2sig/sig2str?
Date: Tue, 25 May 2021 15:11:40 +0200	[thread overview]
Message-ID: <YKz3jNN5ilFL9FEb@calimero.vinschen.de> (raw)
In-Reply-To: <CAF9ehCXxcWH5tufO+m3Tu0pU8-FA3rf6DEPfDj19bD4MrBsO1A@mail.gmail.com>

On May 20 15:23, Joel Sherrill wrote:
> On Thu, May 20, 2021, 2:54 PM Corinna Vinschen <vinschen@redhat.com> wrote:
> 
> > On May 20 09:58, Joel Sherrill wrote:
> > > Hi
> > >
> > > 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
> >
> > I don't see glibc defining the above symbols in the master branch.
> >
> 
> Hmm ... Maybe google found someone's branch.
> 
> 
> > > use an array of { signal, string_name} and a lookup search.
> > > Something similar would be OK for newlib.
> >
> > 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.
> 
> Would it be ok to generalize that and provide the new POSIX as well as the
> BSD interfaces?

Don't ask, just do it.  Let's discuss existing patch proposals.

One problem: strsignal requires thread local storage, which isn't
generically available in newlib.  Ideally Cygwin's strsignal is
rewritten in terms of sig2str, just

- using _my_tls.locals.signamebuf as parameter and

- SIG2STR_MAX must be == sizeof ("Unknown signal 4294967295   ") for
  backward compatibility.


Thanks,
Corinna


  reply	other threads:[~2021-05-25 13:11 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 [this message]
2021-06-16 17:01     ` Brian Inglis

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=YKz3jNN5ilFL9FEb@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=joel@rtems.org \
    --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).