utmpx.h(0P)

πŸ’– PROLOG πŸ’–

okay bestie, real talk before we even start: this page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the tea on Linux behavior specifically), or honestly the interface might just not be implemented on Linux at all. no cap. πŸ™ˆ


✨ NAME ✨

utmpx.h β€” user accounting database definitions 🫢

like, the whole header, the whole vibe. it's giving "who's logged in and what are they doing."


🌸 SYNOPSIS 🌸

#include <utmpx.h>

that's it. that's the whole thing. one include and you're in. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay so. the <utmpx.h> header shall define the utmpx structure, and that struct shall include at least these members:

char            ut_user[]  User login name.
char            ut_id[]    Unspecified initialization process identifier.
char            ut_line[]  Device name.
pid_t           ut_pid     Process ID.
short           ut_type    Type of entry.
struct timeval  ut_tv      Time entry was made.

read it again, bestie, because there will be a quiz. πŸ“

the <utmpx.h> header shall also define the pid_t type through typedef, exactly as described in <sys/types.h>.

the <utmpx.h> header shall define the timeval structure as described in <sys/time.h>.

and heads up πŸ‘€ β€” including <utmpx.h> may also make visible all the symbols from <sys/time.h>. so it's a little two-for-one situation. iconic behavior honestly.


🌈 the ut_type constants (aka the main characters) 🌈

the <utmpx.h> header shall define these symbolic constants as possible values for the ut_type member of the utmpx structure:

  • EMPTY β€” no valid user accounting information. it's giving empty. ghost town. πŸ‘»
  • BOOT_TIME β€” identifies time of system boot. πŸ₯Ύβœ¨
  • OLD_TIME β€” identifies time when system clock changed.
  • NEW_TIME β€” identifies time after system clock changed.
  • USER_PROCESS β€” identifies a process.
  • INIT_PROCESS β€” identifies a process spawned by the init process.
  • LOGIN_PROCESS β€” identifies the session leader of a logged-in user.
  • DEAD_PROCESS β€” identifies a session leader who has exited. πŸ’€ (literally.)

πŸ¦‹ the functions πŸ¦‹

the following shall be declared as functions, and may also be defined as macros. function prototypes shall be provided:

void          endutxent(void);
struct utmpx *getutxent(void);
struct utmpx *getutxid(const struct utmpx *);
struct utmpx *getutxline(const struct utmpx *);
struct utmpx *pututxline(const struct utmpx *);
void          setutxent(void);

look at those little pointer stars. obsessed. ⭐

the following sections are informative. just so you know what you're getting into. 🀍

πŸ“ APPLICATION USAGE πŸ“

None.

nothing. nada. zip. zero notes, bestie, we're all good here. 🫢


🧚 RATIONALE 🧚

None.

no explanation offered and honestly? valid. main character energy. periodt. πŸ’…


⭐ FUTURE DIRECTIONS ⭐

None.

the future is... unspecified. slay, I guess. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • <sys_time.h>
  • <sys_types.h>
  • the System Interfaces volume of POSIX.1‐2017, endutxent()

go read those if you want the full lore. iykyk. πŸ“š


okay so legally I have to tell you this part and I'm gonna tell you it exactly:

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. so if something looks off, the original wins, 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 .


and that's the whole page bestie!! this one came from IEEE/The Open Group, 2017, and the original page title was utmpx.h(0P) β€” mwah, go forth and account for your users. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from