POSIX_SPAWNATTR_GETSIGDEFAULT(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… POSIX_SPAWNATTR_GETSIGDEFAULT(3) β€” get & set the spawn-sigdefault attribute πŸŽ€

okay so bestie, we're in section 3 of the Library Functions Manual and today's main character is a little pair of functions that handle one very specific vibe: the spawn-sigdefault attribute of a spawn attributes object. it's giving "signal reset energy" and honestly? iconic. ✨


πŸ¦‹ LIBRARY πŸ¦‹

Standard C Library (libc, -lc) β€” she lives in libc, no cap πŸ’œ


🌸 SYNOPSIS 🌸

first things first, you gotta invite the header:

#include <spawn.h>

then the two functions, in all their glory:

int
posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict attr,
    sigset_t *restrict sigdefault);

int
posix_spawnattr_setsigdefault(posix_spawnattr_t *attr,
    const sigset_t *restrict sigdefault);

πŸ’– DESCRIPTION πŸ’–

okay so. posix_spawnattr_getsigdefault() gets β€” she obtains the value of the spawn-sigdefault attribute from the attributes object that attr points to. read it, don't touch it, respectfully. πŸ‘‘

and posix_spawnattr_setsigdefault() sets β€” she sets the spawn-sigdefault attribute inside an already-initialized attributes object referenced by attr. you gotta initialize it first bestie, no shortcuts.

now for the actual lore: the spawn-sigdefault attribute represents the set of signals to be forced to default signal handling in the new process image. and like, that only happens if POSIX_SPAWN_SETSIGDEF is set in the spawn-flags attribute, so don't forget that gate πŸšͺ β€” it's conditional, iykyk.

the default value of this attribute? an empty signal set. literally nothing in it. a clean slate. a fresh face. πŸ’€βœ¨


🫢 RETURN VALUES 🫢

both posix_spawnattr_getsigdefault() and posix_spawnattr_setsigdefault() return zero. that's it. zero. slay, consistent queens πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

go read the whole friend group, they all link up:


⭐ STANDARDS ⭐

posix_spawnattr_getsigdefault() and posix_spawnattr_setsigdefault() conform to IEEE Std 1003.1-2001 (β€œPOSIX.1”). certified. paperwork handled. πŸ“œ


🌈 HISTORY 🌈

these two first appeared in FreeBSD 8.0. throwback era fr fr πŸ•°οΈ


πŸ‘‘ AUTHORS πŸ‘‘

Ed Schouten <ed@FreeBSD.org> β€” the icon who brought us here 🫑


and that's the page, bestie! πŸ’… this whole thing came to you courtesy of Debian, dated March 24, 2008 β€” so like, vintage but make it POSIX βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from