SIGADDSET(3P)

πŸ’– SIGADDSET(3P) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual ✨ this one's all about sigaddset(3P), and yes, it's giving "small function, big feelings" energy. let's get into it 🫢


🌸 PROLOG 🌸

so like, real talk first: this page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the deets on Linux behavior, iykyk), or honestly the interface might not even be implemented on Linux at all 😭. no cap, that's just how it is.


✨ NAME ✨

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


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <signal.h>

int sigaddset(sigset_t *set, int signo);

πŸ’… DESCRIPTION πŸ’…

so the sigaddset() function adds the individual signal specified by the signo to the signal set pointed to by set. literally just, adding one signal into the set. slay. πŸ’–

okay now here's the part where you gotta pay attention, bestie, because it's lowkey important:

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. 🚨

and if you don't initialize it that way but still hand it to any of pthread_sigmask(), sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(), sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or sigwaitinfo()? the results are undefined. πŸ’€ not "probably fine", not "vibes-based", just undefined. init your sets, periodt. πŸ™ˆ


⭐ RETURN VALUE ⭐

  • upon successful completion, sigaddset() shall return 0 πŸ‘‘
  • otherwise, it shall return -1 and set errno to indicate the error 😭

πŸ”₯ ERRORS πŸ”₯

the sigaddset() function may fail if:

  • EINVAL β€” The value of the signo argument is an invalid or unsupported signal number. 🚫
The following sections are informative. (translation: cute bonus content, not the rules themselves πŸ’œ)

🌈 EXAMPLES 🌈

None. bestie really said "no examples, figure it out" πŸ’€


πŸŽ€ 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 from 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 absolute icon of a manpage came to you from IEEE/The Open Group, dated 2017, filed under SIGADDSET(3P) πŸ’– go init your signal sets and stay hydrated, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from