public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Matthew Joyce <mfjoyce2004@gmail.com>
To: Newlib <newlib@sourceware.org>, Matt Joyce <mfjoyce2004@gmail.com>
Subject: Re: [PATCH 1/1] libc: Added implementations and prototypes for
Date: Thu, 29 Jul 2021 06:59:28 +0200	[thread overview]
Message-ID: <CALo2L3NVZB=-16GfgGRKT9tEG66+UZ+PTULH6GTshm0mckANNg@mail.gmail.com> (raw)
In-Reply-To: <YQGkqkd8DbXxrUhr@calimero.vinschen.de>

Hi Corinna,

Thank you again for the feedback! I'll make the changes as you
recommend. Two things to note:

1) Regarding the header guard, I'm also all ears! Joel was also
concerned about this but ultimately recommended __GNU_VISIBLE for now,
while there is still no version number. I'll stand by if there are any
alternative suggestions on this.

2) "EXIT": As a beginner, obviously please take what I say with
several grains of salt! My rationale for not including 0 / EXIT was
line 61853 where it states "if signum is equal to 0, the behavior is
unspecified", and the end of the RATIONALE section where it says "the
behavior in this case has been made unspecified." I'd think if we
added in EXIT / 0, we'd be going against those statements.

Thanks again!

Sincerely,

Matt


On Wed, Jul 28, 2021 at 8:40 PM Corinna Vinschen <vinschen@redhat.com> wrote:
>
> On Jul 28 11:11, Corinna Vinschen wrote:
> > Hi Matt,
> >
> > thanks for this v2.
> >
> > On Jul 24 10:37, Matt Joyce wrote:
> > > Added implementations for sig2str() and str2sig() in libc/signal in order
> > > to improve POSIX compliance. Added function prototypes to sys/signal.h.
> > > Added Makefile.am entries to build the new file.
> > > ---
> > > [...]
> > > +#if __GNU_VISIBLE
> >
> > I think this needs discussion.  The sig2str/str2sig API has not been
> > provided yet by GLibC.  Using __GNU_VISIBLE in this context looks wrong.
> > What we need, in fact, is a __POSIX_VISIBLE guard, but here's the
> > problem: As far as I can see, the Issue 8 draft does not yet define a
> > version number.
> >
> > If anybody has better information or a good idea how to guard this new
> > API in the meantime, I'm all ears.
> >
> > >
> > >  include $(srcdir)/../../Makefile.shared
> > >
> > > -CHEWOUT_FILES = psignal.def raise.def signal.def
> > > +CHEWOUT_FILES = psignal.def raise.def signal.def sig2str.def
> >
> > If you add this, you also have to provide a header allowing to create
> > a man page.  See, for instance, newlib/signal/raise.c.
> >
> > > +int
> > > +sig2str(int signum, char *str)
> > > [...]
> > > +  /* If signum is not a recognized signal number, store this message in str. */
> > > +  sprintf(str, "Unknown signal");
> >
> > Just drop this sprintf, as I just wrote in my other mail.  There's no
> > expectation that the incoming buffer gets changed if the function
> > returns with error.
>
> Additionally, there's a RATIONALE section in the draft, which describes
> how "historical versions of these functions translated a signum value 0
> to "EXIT" (and vice versa), so that they could be used by the shell for
> the trap utility."
>
> While this isn't going to become part of the standard, I wonder if we
> should follow suite, for maximum compatibility.
>
>
> Corinna
>

  reply	other threads:[~2021-07-29  4:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24  8:37 [PATCH 0/1] V2 Implementation of sig2str/str2sig Matt Joyce
2021-07-24  8:37 ` [PATCH 1/1] libc: Added implementations and prototypes for Matt Joyce
2021-07-28  9:11   ` Corinna Vinschen
2021-07-28 15:25     ` Brian Inglis
2021-07-28 18:46       ` Corinna Vinschen
2021-07-28 19:42         ` Joel Sherrill
     [not found]           ` <DM3P110MB0522CE441CAB289B69DE18B49AEA9@DM3P110MB0522.NAMP110.PROD.OUTLOOK.COM>
2021-07-28 19:54             ` Fw: " C Howland
2021-07-28 20:13               ` Joel Sherrill
2021-07-29  9:23                 ` Corinna Vinschen
2021-07-29 14:45                   ` Eric Blake
2021-07-29 15:29                   ` Brian Inglis
2021-07-29 15:29                   ` Brian Inglis
2021-07-29 15:45                     ` Corinna Vinschen
2021-07-29  2:51         ` Brian Inglis
2021-07-28 18:40     ` Corinna Vinschen
2021-07-29  4:59       ` Matthew Joyce [this message]
2021-07-29  9:27         ` Corinna Vinschen
2021-07-29 14:41     ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2021-07-17 10:10 [PATCH 0/1] Implementation of sig2str/str2sig Matt Joyce
2021-07-17 10:10 ` [PATCH 1/1] libc: Added implementations and prototypes for Matt Joyce
2021-07-19  9:47   ` Corinna Vinschen
2021-07-19 13:19     ` Joel Sherrill
2021-07-19 14:31       ` Corinna Vinschen
2021-07-20  5:11         ` Matthew Joyce
2021-07-22  5:14         ` Matthew Joyce
2021-07-22  7:55           ` Corinna Vinschen
2021-07-23  5:44             ` Matthew Joyce
2021-07-28  8:44               ` Corinna Vinschen

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='CALo2L3NVZB=-16GfgGRKT9tEG66+UZ+PTULH6GTshm0mckANNg@mail.gmail.com' \
    --to=mfjoyce2004@gmail.com \
    --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).