POSIX_SPAWNATTR_GETPROCDESCP_NP(3)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’– POSIX_SPAWNATTR_GETPROCDESCP_NP(3) πŸ’–

okay so quick source-reality check, bestie: the header at the very top literally says POSIX_SPAWNATTR_GETPROCD(3), and the manual is Library Functions Manual β€” but the page we're doing is POSIX_SPAWNATTR_GETPROCDESCP_NP(3). We're in the process-descriptor corner of spawn-attribute town. ✨


🌸 NAME 🌸

posix_spawnattr_getprocdesp_np, posix_spawnattr_setprocdescp_np β€” get and set the spawn-procdescp attribute of a spawn attributes object.

(yes, getprocdesp_np is written like that in the NAME line β€” preserving the source's exact energy, no cap πŸ’…)

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc).

✨ SYNOPSIS ✨

#include <spawn.h>

int
posix_spawnattr_getprocdescp_np(const posix_spawnattr_t *restrict attr,
    int **restrict fdpp, int *restrict pdrflagsp);

int
posix_spawnattr_setprocdescp_np(posix_spawnattr_t *attr,
    int *restrict fdp, int pdrflags);

πŸ¦‹ DESCRIPTION πŸ¦‹

posix_spawnattr_getprocdescp_np() obtains the value of the spawn-procdescp attribute from the attributes object referenced by attr. Get it, bestie. πŸ’–

The description then literally calls the setter posix_spawnattr_procdescp_np() β€” that's the name as printed in the source, not me being chaotic β€” and that function sets the spawn-procdescp attribute in an initialized attributes object referenced by attr. 🫢

The spawn-procdescp attribute provides the location where the child process's file descriptor will be stored after a successful spawn. Setting the attribute to a non-NULL value implicitly request the creation of the file descriptor that references the child process.

It wiil be created by the pdrfork(2) system call. which will be used instead of fork/vfork/rfork(2) when the attribute is set to NULL.

If the attribute is set to a value other then NULL, it must be a valid pointer to a variable of int type, where the resulting descriptor will be stored. The pdrflags argument specifies additional flags that are accepted by the pdfork(2) system call. See its description for the list of the valid flags. Note that the PD_CLOEXEC flag is always set, preventing leakage of the process descriptor into the newly created child. πŸ”’

The default value for the spawn-procdescp attribute is NULL, which means that no process descriptor will be created.

πŸ’– RETURN VALUES πŸ’–

The posix_spawnattr_getprocdescp_np() and posix_spawnattr_setprocdescp_np() functions return zero. That's it. Zero. slay. ✨

πŸ‘€ SEE ALSO πŸ‘€

🌈 STANDARDS 🌈

The posix_spawnattr_getprocdescp_np() and posix_spawnattr_setprocdescp_np() are FreeBSD extensions that first appeared in FreeBSD 16.0.


mwah, bye bestie 🫢 β€” this footer energy is Debian, dated January 26, 2 in the source, right before the footer string collides with POSIX_SPAWNATTR_GETPROCDESCP_NP(3). Keeping it exactly as shown, no invented year, periodt. πŸŽ€

πŸ“¦ where this page comes from