SETEGID(3POSIX)

πŸ’– SETEGID(3POSIX) πŸ’–

okay bestie, so this is a page from the POSIX Programmer's Manual, and we're talking about setegid β€” the girl whose whole job is setting the effective group ID. πŸŽ€


🌸 PROLOG 🌸

okay so real talk before we dive in: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for the details of Linux behavior β€” or the interface may not even be implemented on Linux at all. πŸ™ˆ iykyk.


✨ NAME ✨

setegid β€” set the effective group ID πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <unistd.h>

int setegid(gid_t gid);

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea. If gid is equal to the real group ID or the saved set-group-ID, or if the process has appropriate privileges, setegid() shall set the effective group ID of the calling process to gid. ✨

and the way that it does this β€” it leaves the real group ID, the saved set-group-ID, and any supplementary group IDs unchanged. no touchy. πŸ™…β™€οΈ

also, the setegid() function shall not affect the supplementary group list in any way. like, at all. not even a little. πŸ’€


πŸ”₯ RETURN VALUE πŸ”₯

upon successful completion, 0 shall be returned. slay. πŸ’–

otherwise, -1 shall be returned and errno set to indicate the error. 😭


πŸ‘‘ ERRORS πŸ‘‘

the setegid() function shall fail if:

  • EINVAL β€” the value of the gid argument is invalid and is not supported by the implementation. not me getting an invalid gid bestie 😭
  • EPERM β€” the process does not have appropriate privileges and gid does not match the real group ID or the saved set-group-ID. so like, you don't have the privileges and you don't match? denied. periodt. πŸ’…
the following sections are informative. (translation: the actual requirements live above, this part is just vibes and lore 🧚)

πŸ“ EXAMPLES πŸ“

None.

like. literally none. nothing here. the void. πŸ’€


🌈 APPLICATION USAGE 🌈

None.

also none. bestie we are running on empty. ✨


πŸ’œ RATIONALE πŸ’œ

Refer to the RATIONALE section in setuid(). that's it, that's the whole thing β€” go read her page, she has the lore. 🫢


🧚 FUTURE DIRECTIONS 🧚

None.

the future holds... nothing for this one. iconic honestly. ⭐


🌸 SEE ALSO 🌸

  • exec
  • getegid()
  • geteuid()
  • getgid()
  • getuid()
  • seteuid()
  • setgid()
  • setregid()
  • setreuid()
  • setuid()

and the Base Definitions volume of POSIX.1‐2017, <sys_types.h>, <unistd.h> πŸ“š


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 .


and that's a wrap bestie πŸŽ€ this whole thing was brought to you by IEEE/The Open Group, dated 2017, filed under SETEGID(3POSIX). mwah. πŸ’‹βœ¨