GETGID(2)
β¨ GETGID β¨ β System Calls Manual
okay bestie, welcome to the GETGID(2) page π
this is the one about finding out who your group is at the process level. group chat energy, but make it syscall. let's go π«Ά
πΈ NAME πΈ
getgid, getegid β get group process identification
like, it tells you the group ID stuff of a process. iykyk. π
π LIBRARY π
Standard C Library (libc, -lc)
π¦ SYNOPSIS π¦
#include <unistd.h>
gid_t
getgid(void);
gid_t
getegid(void);
two lil functions, both returning a gid_t, both taking void (aka nothing, they don't want your arguments, they want nothing π«). periodt.
β¨ DESCRIPTION β¨
so. the getgid() system call hands you back the real group ID of the calling process, and getegid() hands you back the effective group ID of the calling process. that's it. that's the whole vibe. π
the real group ID is specified at login time. it's like the group you were born with, no edits, no filters. π
and more specifically: the real group ID is the group of the user who invoked the program. it's their group, the original one, the main character. π
the effective group ID though? it's giving extra permissions. it gives the process additional permissions during the execution of "set-group-ID" mode processes. so it's the ID that's actually flexing during runtime. π
because of all that, getgid() is used to determine the real-user-id of the calling process. yes bestie, that's what it says, we're keeping it exactly as written, no notes. π
π ERRORS π
ngl, there's nothing here to stress about:
- the
getgid()andgetegid()system calls are always successful, and no return value is reserved to indicate an error.
so like, they literally cannot fail. iconic behavior honestly. no error handling needed, go touch grass. πΈ
π SEE ALSO π
go read those next, bestie, they're all in the same group chat π«Ά
β STANDARDS β
the getgid() and getegid() system calls are expected to conform to ISO/IEC 9945-1:1990 ("POSIX.1"). standards girlie behavior. ate. π
π§ HISTORY π§
the getgid() function appeared in Version 4 AT&T UNIX. ancient. vintage. literally a classic. π
okay that's the whole page, no cap. your group IDs are safe, your permissions are understood, and you didn't have to read a single boring sentence. you're welcome. π
this page came from the Debian crew, dated May 1, 2020, filed under GETGID(2). mwah, love u, bye bestie πβ¨
π¦ 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) 1983, 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