GETGID(3POSIX)
π GETGID π
okay so bestie, before we even get into it: this page is part of the POSIX Programmer's Manual (the GETGID(3POSIX) one, iykyk). Important tea though β the Linux implementation of this interface may differ, so you gotta consult the corresponding Linux manual page for the details of Linux behavior. orrrrr the interface might just not be implemented on Linux at all π so don't come for me.
β¨ NAME β¨
getgid β get the real group ID π
πΈ SYNOPSIS πΈ
#include <unistd.h>
gid_t getgid(void);
like that's it. that's the whole thing. iconic.
π¦ DESCRIPTION π¦
So the getgid() function shall return the real group ID of the calling process. periodt.
And here's the slay detail: getgid() shall not modify errno. it's just gonna sit there, be correct, and not touch anything. main character behavior honestly.
β RETURN VALUE β
The getgid() function shall always be successful, and no return value is reserved to indicate an error. like it literally cannot fail. no cap. it's giving "born to succeed, forced to... also succeed."
π ERRORS π
No errors are defined. not a single one. zero. the void. π«Ά
The following sections are informative. (translation: the fun part is over, but we keep reading anyway because we're thorough π)
π EXAMPLES π
None. literally nothing here bestie, sorry π
π APPLICATION USAGE π
None. also nothing. we move. β¨
π§ RATIONALE π§
okay so the lore: in a conforming environment, getgid() will always succeed. it's just built different.
It is possible for implementations to provide an extension where a process in a non-conforming environment will not be associated with a user or group ID. like a little mystery process, no user, no group, just vibes.
And it is recommended that such implementations return (gid_t)-1 and set errno to indicate such an environment. Doing so does not violate this standard, since such an environment is already an extension. so like, it's allowed to be weird, because it was already being weird. checks out. π
π₯ FUTURE DIRECTIONS π₯
None. the future is empty. we love a stable API. β
π SEE ALSO π
getegid()geteuid()getuid()setegid()seteuid()setgid()setregid()setreuid()setuid()
Also the Base Definitions volume of POSIX.1β2017, <sys_types.h>, <unistd.h> β go read those too, bestie, they're in the group chat.
π COPYRIGHT π
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 .
no cap: keep every one of these facts exactly as written, because the copyright and the standard are doing the absolute most and they are not the vibe to paraphrase.
and that's the whole page, bestie π this was IEEE/The Open Group, 2017 bringing you GETGID(3POSIX) β thanks for reading, mwah πβ¨π¦
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms