pwd.h(7POSIX)

🌸 pwd.h(7POSIX) 🌸

okay bestie, so this little cutie is a POSIX Programmer's Manual page β€” like, from the POSIX girlies themselves, not the Linux girlies. πŸ’…


✨ PROLOG ✨

This manual page is part of the POSIX Programmer's Manual, periodt. But heads up: the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not even be implemented on Linux at all. πŸ™ˆ


πŸ’– NAME πŸ’–

pwd.h β€” password structure. that's it, that's the name. iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <pwd.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So the <pwd.h> header shall define the struct passwd structure, and it has to include at least these members, no cap:

char    *pw_name   User's login name.
uid_t    pw_uid    Numerical user ID.
gid_t    pw_gid    Numerical group ID.
char    *pw_dir    Initial working directory.
char    *pw_shell  Program to use as shell.

Then, the <pwd.h> header shall define the gid_t, uid_t, and size_t types, exactly as described over in <sys/types.h>. slay, cross-header teamwork. 🀝

And the following shall be declared as functions β€” they may also be defined as macros, and function prototypes shall be provided, bestie, that's not optional:

void           endpwent(void);
struct passwd *getpwent(void);
struct passwd *getpwnam(const char *);
int            getpwnam_r(const char *, struct passwd *, char *,
                   size_t, struct passwd **);
struct passwd *getpwuid(uid_t);
int            getpwuid_r(uid_t, struct passwd *, char *,
                   size_t, struct passwd **);
void           setpwent(void);

The following sections are informative β€” like, they're the vibes, not the rules. πŸ’«


🌈 APPLICATION USAGE 🌈

None. literally nothing. we're all booked and busy. πŸ’€


⭐ RATIONALE ⭐

None. again, nothing. the reasoning is simply not giving today. 🫢


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None. the future is unknown and honestly that's on brand. 🧚


πŸ’œ SEE ALSO πŸ’œ

  • <sys_types.h>

And from the System Interfaces volume of POSIX.1‐2017: endpwent(), getpwnam(), getpwuid() β€” go read those, they're the main characters of this whole friend group. πŸ‘‘


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.

and if there's ever 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. it wins. always. no debate. βš–οΈ

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 .


okay that's the whole page, you ate that fr fr. this diva was brought to you by IEEE/The Open Group, 2017 β€” mwah, sending you the biggest kiss, go forth and getpwnam() responsibly πŸ’–βœ¨πŸŽ€