public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Firas Cheaib <firas.cheaib@firascheaib.com>
To: "libc-help@sourceware.org" <libc-help@sourceware.org>
Subject: Signal() Implementation
Date: Thu, 11 May 2023 13:44:48 +0000	[thread overview]
Message-ID: <Iiix0pHXg24pslaQgg2EwVQLDqBQiLH0SjC2SyUuT4efpQX7Pq1K3JgHtSIe4VKjMKnprcvKteOP24-euLCM3DlVr1l3808zXzAfPkcgrwQ=@firascheaib.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

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;}

Thanks,
-Firas

             reply	other threads:[~2023-05-11 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 13:44 Firas Cheaib [this message]
2023-05-11 14:18 ` Joe Simmons-Talbott

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='Iiix0pHXg24pslaQgg2EwVQLDqBQiLH0SjC2SyUuT4efpQX7Pq1K3JgHtSIe4VKjMKnprcvKteOP24-euLCM3DlVr1l3808zXzAfPkcgrwQ=@firascheaib.com' \
    --to=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).