grp.h(0P)

🌸 PROLOG 🌸

okay bestie, tiny heads up before we get into it πŸ’– this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux at all πŸ™ˆ so like… vibe check your platform first, fr fr.


πŸ‘‘ NAME πŸ‘‘

grp.h β€” group structure. that's it. that's the name. short, sweet, iconic πŸ’…


✨ SYNOPSIS ✨

#include <grp.h>

like, that's the whole move. one include and you're in 🫢


πŸ’– DESCRIPTION πŸ’–

so the <grp.h> header shall declare the group structure, and that structure shall include these members:

char   *gr_name The name of the group.
gid_t   gr_gid  Numerical group ID.
char  **gr_mem  Pointer to a null-terminated array of character
                pointers to member names.

periodt. gr_name is the name of the group, gr_gid is the numerical group ID, and gr_mem is a pointer to a null-terminated array of character pointers to member names 🌸

and bestie, the <grp.h> header shall also define the gid_t and size_t types as described in <sys/types.h> β€” so that's where those cuties come from πŸ”₯

now the main character energy: the following shall be declared as functions and may also be defined as macros. function prototypes shall be provided. (yes, both. it's giving versatile πŸ’…)

void           endgrent(void);
struct group  *getgrent(void);
struct group  *getgrgid(gid_t);
int            getgrgid_r(gid_t, struct group *, char *,
                   size_t, struct group **);
struct group  *getgrnam(const char *);
int            getgrnam_r(const char *, struct group *, char *,
                   size_t , struct group **);
void           setgrent(void);

okay and just so you know β€” the following sections are informative. (that's their whole thing, they're the chill informative ones, not the rules-rules ones πŸ‘‘)


πŸŽ€ APPLICATION USAGE πŸŽ€

None.

like, literally none. nothing to add. the page said what it said πŸ’€


πŸ¦‹ RATIONALE πŸ¦‹

None.

nope, no rationale here either. it's giving mystery, it's giving "we just didn't" ✨


🌈 FUTURE DIRECTIONS 🌈

None.

no future plans bestie, this is the final form 🫢


πŸ“ SEE ALSO πŸ“

  • <sys_types.h>
  • The System Interfaces volume of POSIX.1‐2017, endgrent(), getgrgid(), getgrnam()

go read those if you wanna go deeper, iykyk πŸ“š


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 .

ok bestie that's the whole legal situation, no cap β€” if something looks off between this page and the actual Standard, the Standard wins, periodt πŸ’…

and that's the page!! mwah πŸ’– this lil masterpiece came from IEEE/The Open Group, dated 2017, and it lives at grp.h(0P) β€” slay, ate, no crumbs, see you in the next man page bestie πŸ‘‘βœ¨

πŸ“¦ where this page comes from