POSIX_S...SIGMASK(3POSIX)
πΈ PROLOG πΈ
ok so real talk before we even start: this page is part of the POSIX Programmer's Manual. and like, huge disclaimer bestie β the Linux implementation of this interface may differ (so pls consult the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface might just... not be implemented on Linux at all. π so vibe check your platform first.
β¨ NAME β¨
posix_spawnattr_getsigmask, posix_spawnattr_setsigmask β get and set the spawn-sigmask attribute of a spawn attributes object (ADVANCED REALTIME) π
yes we're in the POSIX Programmer's Manual, section 3POSIX, and yes this is the advanced realtime girlies' table. pull up a chair. π«Ά
π SYNOPSIS π
#include <signal.h>
#include <spawn.h>
int posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict attr,
sigset_t *restrict sigmask);
int posix_spawnattr_setsigmask(posix_spawnattr_t *restrict attr,
const sigset_t *restrict sigmask);
look at that. two little functions. restrict everywhere. iconic behavior honestly. π
π DESCRIPTION π
okay so here's the tea:
posix_spawnattr_getsigmask()shall obtain the value of the spawn-sigmask attribute from the attributes object referenced byattr. it's the getter. it goes and gets. π§posix_spawnattr_setsigmask()shall set the spawn-sigmask attribute in an initialized attributes object referenced byattr. (key word: initialized, bestie β don't come at it with an uninitialized object, that's not the move.) β¨
now, what even is the spawn-sigmask attribute, you ask? great question, so glad you asked. π¦
the spawn-sigmask attribute represents the signal mask in effect in the new process image of a spawn operation β but ONLY if POSIX_SPAWN_SETSIGMASK is set in the spawn-flags attribute. no flag, no mask-in-effect, that's the deal.
and the default value of this attribute is unspecified. so like... don't assume. it's giving mystery. π
β RETURN VALUE β
- upon successful completion,
posix_spawnattr_getsigmask()shall return zero and store the value of the spawn-sigmask attribute ofattrinto the object referenced by thesigmaskparameter. otherwise, an error number shall be returned to indicate the error. π - upon successful completion,
posix_spawnattr_setsigmask()shall return zero. otherwise, an error number shall be returned to indicate the error.
so zero = slay, nonzero = the error number is right there telling you what went wrong. periodt. π
π₯ ERRORS π₯
these functions may fail if:
EINVALβ the value specified byattris invalid.
the posix_spawnattr_setsigmask() function may fail if:
EINVALβ the value of the attribute being set is not valid.
okay so both of these say may fail, not shall fail. read it again. the manpage is being specific and we're respecting the specificity. no cap. π
the following sections are informative. (translation: the spec part is done, the rest is commentary, but we're still reading all of it because we're thorough like that π)
π EXAMPLES π
None.
literally nothing. the void. empty. she said no examples, and honestly? respect. π
π APPLICATION USAGE π
these functions are part of the Spawn option and need not be provided on all implementations.
so like... check before you commit. some systems just don't have the Spawn option and that's their business. π
πΈ RATIONALE πΈ
None.
nothing to justify. it simply is. main character energy. β¨
π¦ FUTURE DIRECTIONS π¦
None.
the future is bright and also empty. she stays exactly as she is. π
π SEE ALSO π
posix_spawn()posix_spawnattr_destroy()posix_spawnattr_getsigdefault()posix_spawnattr_getflags()posix_spawnattr_getpgroup()posix_spawnattr_getschedparam()posix_spawnattr_getschedpolicy()
and from the Base Definitions volume of POSIX.1β2017: <signal.h>, <spawn.h> π
(that's the friend group. go read the rest of them, iykyk.)
π COPYRIGHT π
okay legal moment, stay with me, this matters:
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 .
fr fr do not sleep on the referee document clause. if this page and the Standard ever disagree, the Standard wins. every time. that's the rule. π
and that's the whole page bestie!! π«Ά this one came to you courtesy of IEEE / The Open Group, dated 2017, living in the POSIX Programmer's Manual as POSIX_S...SIGMASK(3POSIX). mwah. go set your signal masks responsibly. πβ¨π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms