POSIX_SPAWNATTR_GETFLAGS(3)
β¨ POSIX_SPAWNATTR_GETFLAGS π
okay bestie, so this is a <italic>Library Functions Manual</italic> moment β specifically the POSIX_SPAWNATTR_GETFLAGS(3) page β and it's literally the getter/setter duo for the spawn-flags attribute on a spawn attributes object. tiny API, big main character energy. let's get into it π
πΈ NAME πΈ
posix_spawnattr_getflags, posix_spawnattr_setflags β get and set the spawn-flags attribute of a spawn attributes object β¨
π¦ LIBRARY π¦
Standard C Library (libc, -lc) β she's literally built in, no extra linking drama π
β SYNOPSIS β
#include <spawn.h>
int
posix_spawnattr_getflags(const posix_spawnattr_t *restrict attr,
short *restrict flags);
int
posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags);
π DESCRIPTION π
so posix_spawnattr_getflags() obtains the value of the spawn-flags attribute from the attributes object that attr points at. it's the read side. the vibes-extraction function. π«Ά
and posix_spawnattr_setflags() sets the spawn-flags attribute in an initialized attributes object referenced by attr. initialized is doing a lot of work in that sentence babe, don't skip it.
the spawn-flags attribute is the whole point of this page: it tells the system which process attributes are gonna be changed in the new process image when you invoke posix_spawn() or posix_spawnp(). and how do you build it? it's the bitwise-inclusive OR of zero or more of these flags (see posix_spawn()):
POSIX_SPAWN_RESETIDSPOSIX_SPAWN_SETPGROUPPOSIX_SPAWN_SETSIGDEFPOSIX_SPAWN_SETSIGMASKPOSIX_SPAWN_SETSCHEDPARAMPOSIX_SPAWN_SETSCHEDULERPOSIX_SPAWN_DISABLE_ASLR_NP
these flags live in <spawn.h> β that's where they're defined, periodt. π
π heads up: the default value of this attribute is as if no flags were set. so if you never touch it, you get the empty-vibes version. not a bug, just the default.
π§ RETURN VALUES π§
posix_spawnattr_getflags()β returns zero. that's it. that's the whole return value story. πposix_spawnattr_setflags()β returns zero on success, andEINVALon failure due to an invalid flag being specified. so if you pass her something cursed, she'll tell you. π
π₯ SEE ALSO π₯
go read the whole squad, they're all linked, iykyk π
π STANDARDS π
posix_spawnattr_getflags() and posix_spawnattr_setflags() conform to IEEE Std 1003.1-2001 (βPOSIX.1β). certified. official. iconic. β
π HISTORY π
posix_spawnattr_getflags() and posix_spawnattr_setflags() first appeared in FreeBSD 8.0. vintage but make it fresh π¦
π AUTHORS π
Ed Schouten <ed@FreeBSD.org> β thank you for your service, king π
okay that's the whole page bestie, no notes, go forth and set those flags responsibly π«Άπ
sign-off: this one came from the Debian crew, dated March 4, 2024, and it's the POSIX_SPAWNATTR_GETFLAGS(3) page β mwah, love u, bye πβ¨
π¦ 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