SIGISMEMBER(3P)

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

okay bestie so this is sigismember, and it lives in the POSIX Programmer's Manual (that's the 3P girlies πŸŽ€). buckle up, it's a short one but it's iconic.


🌸 PROLOG 🌸

okay so real talk before we even start: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for the tea on Linux behavior. or like… the interface might not even be implemented on Linux at all. πŸ’€ not me warning you upfront. i'm just saying. check first.


✨ NAME ✨

sigismember β€” test for a signal in a signal set 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <signal.h>

int sigismember(const sigset_t *set, int signo);

that's it. that's the whole vibe. one include, one function. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so the sigismember() function shall test whether the signal specified by signo is a member of the set pointed to by set. literally it's just "hey, is this signal in this set or not" β€” the most nosy little function and i love her for it. πŸ’–

🚨 MAJOR PSA, DO NOT SKIP THIS ONE BESTIE 🚨

applications should call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object. like, at least once. before you do anything else with it.

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

undefined. as in, we do not know what happens. as in, not it. πŸ™ˆ initialize your sigset_t first, periodt. βœ‹


πŸ”₯ RETURN VALUE πŸ”₯

upon successful completion, sigismember() shall return 1 if the specified signal is a member of the specified set, or 0 if it is not. so it's giving boolean, it's giving yes/no, it's giving main character energy. πŸ‘‘

otherwise, it shall return -1 and set errno to indicate the error. 😭


πŸ’€ ERRORS πŸ’€

the sigismember() function may fail if:

  • EINVAL β€” the signo argument is not a valid signal number, or is an unsupported signal number. like bestie that's just not a real signal, we can't work with that. 🚫

the following sections are informative. (fancy word for "it's extra, not a requirement, but here's the tea anyway") β˜•


🌈 EXAMPLES 🌈

None.

literally none. the void. the emptiness. it's giving minimalism. πŸ•³οΈβœ¨


🌸 APPLICATION USAGE 🌸

None.

nothing to add, she's self-explanatory. 🧚


πŸŽ€ RATIONALE πŸŽ€

None.

no reasoning given. she simply is. πŸ’…


⭐ FUTURE DIRECTIONS ⭐

None.

the future is unwritten. or like, unwritten in this specific section. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

  • Section 2.4, Signal Concepts
  • pthread_sigmask()
  • sigaction()
  • sigaddset()
  • sigdelset()
  • sigfillset()
  • sigemptyset()
  • 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 is the final boss, basically. πŸ†)

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 . πŸ›


okay that's the whole page bestie, we ate and left no crumbs πŸ“βœ¨ this one came to you from IEEE/The Open Group, 2017, and it's the SIGISMEMBER(3P) page β€” go forth, initialize your signal sets, and slay. πŸ’…πŸ«ΆπŸ’–

πŸ“¦ where this page comes from