POSIX_SPAWNATTR_SETSIGDEFAULT(3)
π 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:
posix_spawn(3)posix_spawnattr_destroy(3)posix_spawnattr_getsigmask(3)posix_spawnattr_init(3)posix_spawnattr_setsigmask(3)posix_spawnp(3)
β 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
- Copyright (C) 2001-2004 by the Institute of
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms