SIGADDSET(3POSIX)

πŸ’– SIGADDSET β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so real talk: this page is part of the POSIX Programmer's Manual. and like, lowkey important heads-up β€” the Linux implementation of this interface may differ (so pls consult the corresponding Linux manual page for the details of Linux behavior), or honestly the interface may not even be implemented on Linux at all. πŸ™ˆ just so you know.


✨ NAME ✨

sigaddset β€” add a signal to a signal set πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <signal.h>

int sigaddset(sigset_t *set, int signo);

🌸 DESCRIPTION 🌸

So what does she do? The sigaddset() function adds the individual signal specified by the signo to the signal set pointed to by set. that's it. that's the whole vibe. one signal, one set, iconic behavior. πŸ’…

⚠️ okay bestie this next part is NOT optional, it's giving mandatory:

Applications shall call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object. if such an object is not initialized in this way, but is nonetheless supplied as an argument to any of pthread_sigmask(), sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(), sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or sigwaitinfo(), the results are undefined. 😭 not "a little weird", not "probably fine" β€” undefined. do the init. fr fr.


πŸ‘‘ RETURN VALUE πŸ‘‘

Upon successful completion, sigaddset() shall return 0 ✨ otherwise, it shall return -1 and set errno to indicate the error. so like, 0 is the slay, -1 is the we have a problem.


πŸ’€ ERRORS πŸ’€

The sigaddset() function may fail if:

  • EINVAL β€” the value of the signo argument is an invalid or unsupported signal number. 🚫
heads up: the following sections are informative β€” meaning they're the commentary, not the law.

🧚 EXAMPLES 🧚

None.

(yes literally none, she said what she said)


🌈 APPLICATION USAGE 🌈

None.


πŸ“ RATIONALE πŸ“

None.


⭐ FUTURE DIRECTIONS ⭐

None.


🫢 SEE ALSO 🫢

  • Section 2.4, Signal Concepts
  • pthread_sigmask()
  • sigaction()
  • sigdelset()
  • sigemptyset()
  • sigfillset()
  • sigismember()
  • sigpending()
  • sigsuspend()

and also: The Base Definitions volume of POSIX.1‐2017, <signal.h> πŸ’œ


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie πŸ’– this lil drop was brought to you by IEEE/The Open Group, dated 2017 β€” sigaddset, out. mwah. πŸŽ€βœ¨