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.


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 πŸ’–βœ¨πŸ¦‹