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() and getegid() 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