SETPGRP(3P)
π hey bestie, welcome to SETPGRP(3P) π
okay so this is a page from the POSIX Programmer's Manual (you know, the whole SETPGRP(3P) situation, POSIX section 3P, we love her). before we dive in, real talk:
β οΈ this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β so go check the corresponding Linux manual page for the deets on Linux behavior. or honestly? the interface might not even be implemented on Linux at all. π
β¨ NAME β¨
setpgrp β set the process group ID π
π¦ SYNOPSIS π¦
#include <unistd.h>
pid_t setpgrp(void);
like. that's it. that's the whole vibe. no arguments, no nothing. she's low maintenance.
πΈ DESCRIPTION πΈ
okay so here's the tea β
If the calling process is not already a session leader, setpgrp() sets the process group ID of the calling process to the process ID of the calling process. like, it just makes the process its own group leader, periodt.
And if setpgrp() creates a new session? then that new session has no controlling terminal. no cap, no tty, nothing. it's giving "main character who moved out and has no address." π§
But here's the important part: setpgrp() has no effect when the calling process is already a session leader. like she already ate, she's not hungry, nothing happens. π
π RETURN VALUE π
Upon completion, setpgrp() shall return the process group ID. that's the whole return value. iconic behavior honestly.
π ERRORS π
No errors are defined.
(yeah. zero. she simply does not miss. π )
The following sections are informative. π (translation: the next bits are context, not gospel β but we still read them because we're nosy and we support women's wrongs.)
π EXAMPLES π
None.
truly nothing. an empty plate. a blank canvas. we respect the minimalism π«Ά
π APPLICATION USAGE π
so here's the thing bestie, and you're gonna want to sit down for this one:
It is unspecified whether this function behaves as setpgid(0,0) or setsid() β unless the process is already a session leader. like, she could go either way and nobody's telling you which. π
Therefore, applications are encouraged to use setpgid() or setsid() as appropriate. like, just pick the one you actually mean, babe. don't make setpgrp() guess. she's guessing. she doesn't know. π
π RATIONALE π
None.
no reasoning given. she simply exists. mysterious queen energy π
β FUTURE DIRECTIONS β
The setpgrp() function may be removed in a future version.
π¨ bestie. she's on the chopping block. deprecated-adjacent. don't build your whole personality on this one. this is your sign to migrate. π
π₯ SEE ALSO π₯
execfork()getpid()getsid()kill()setpgid()setsid()
and also: The Base Definitions volume of POSIX.1β2017, <unistd.h> π
π COPYRIGHT π
okay legal moment, stay with me:
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 .
and that's the whole page, bestie!! πβ¨ππ¦πΈπ π«Ά
this lil masterpiece came to you courtesy of IEEE/The Open Group, dated 2017 β so like, shoutout to them, mwah, thanks for the lore. now go call setsid() instead, ily, bye!! ππ
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms