SETSID(2)
β¨ SETSID(2) β¨
okay bestie, gather round π this is the System Calls Manual page for setsid β she's a libc girlie from the Standard C Library (libc, -lc), and honestly? she's iconic. no cap.
πΈ NAME πΈ
setsid β create session and set process group ID π
π¦ LIBRARY π¦
Standard C Library (libc, -lc)
β¨ SYNOPSIS β¨
#include <unistd.h>
pid_t
setsid(void);
π DESCRIPTION π
So. The setsid() system call creates a new session. That's the whole vibe. π
The calling process is the session leader of the new session, is the process group leader of a new process group, and has no controlling terminal. Literally no terminal. Not a single one. She's untethered. π¦
And the calling process is the only process in either the session or the process group. main character energy, fr fr β nobody else is in the group chat. π
π«Ά RETURN VALUES π«Ά
Upon successful completion, the setsid() system call returns the value of the process group ID of the new process group, which is the same as the process ID of the calling process. slay. β¨
If an error occurs, setsid() returns -1 and the global variable errno is set to indicate the error. π classic.
π ERRORS π
The setsid() system call will fail if:
[EPERM]β The calling process is already a process group leader, or the process group ID of a process other than the calling process matches the process ID of the calling process.
bestie. if you're already a group leader, you cannot simply become a new group leader. it's giving "you can't sit with us, you're already sitting." π
π SEE ALSO π
iykyk π
β STANDARDS β
The setsid() system call is expected to be compliant with the ISO/IEC 9945-1:1990 (βPOSIX.1β) specification. periodt. π
mwah π this page came from Debian, dated June 4, 1993 β yes she's an elder but she's still serving, and that's the whole point. stan a legacy syscall. πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms