public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Joe Simmons-Talbott <josimmon@redhat.com>
To: Firas Cheaib <firas.cheaib@firascheaib.com>
Cc: "libc-help@sourceware.org" <libc-help@sourceware.org>
Subject: Re: Signal() Implementation
Date: Thu, 11 May 2023 10:18:22 -0400	[thread overview]
Message-ID: <20230511141822.GP2106608@oak> (raw)
In-Reply-To: <Iiix0pHXg24pslaQgg2EwVQLDqBQiLH0SjC2SyUuT4efpQX7Pq1K3JgHtSIe4VKjMKnprcvKteOP24-euLCM3DlVr1l3808zXzAfPkcgrwQ=@firascheaib.com>

On Thu, May 11, 2023 at 01:44:48PM +0000, Firas Cheaib wrote:
> Under signal/signal.c the comment header states the following:
> 
> /* Set the handler for the signal SIG to HANDLER,
> returning the old handler, or SIG_ERR on error. */
> 
> Yet the function doesn't return the old handler at any point, it only returns SIG_ERR.
> Is my understanding correct? If so, is the comment wrong and should be corrected?
> I understand that using signal() is to be avoided and I should use sigaction instead.
> 
> __sighandler_t
> signal (int sig, __sighandler_t handler)
> {
> __set_errno (ENOSYS);
> return SIG_ERR;}

This is a stub function the actual implementation is elsewhere.  It
looks like it is __sysv_signal() in sysdeps/posix/sysv_signal.c.  Both
have the same comment which seems to be a clue as to the requirements in
signal/signal.c

Thanks,
Joe


      reply	other threads:[~2023-05-11 14:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 13:44 Firas Cheaib
2023-05-11 14:18 ` Joe Simmons-Talbott [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=20230511141822.GP2106608@oak \
    --to=josimmon@redhat.com \
    --cc=firas.cheaib@firascheaib.com \
    --cc=libc-help@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).