UTEMPTER_ADD_RECORD(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

okay bestie, this is the utempter_add_record(3) page from the Library Functions Manual, and it's giving "deeply specific Unix compatibility interface" in the best way πŸ’…βœ¨

🌸 NAME

  • utempter_add_record, utempter_remove_added_record, utempter_remove_record, addToUtmp, removeFromUtmp, removeLineFromUtmp β€” the whole utempter compatibility interface, no cap 🫢

πŸ¦‹ LIBRARY

User Login Record Library (libulog, -lulog) β€” that's the library, bestie πŸ’–

⭐ SYNOPSIS

#include <utempter.h>

int
utempter_add_record(int fd, const char *host);

int
utempter_remove_added_record(void);

int
utempter_remove_record(int fd);

void
addToUtmp(const char *pty, const char *host, int fd);

void
removeFromUtmp(void);

void
removeLineFromUtmp(const char *pty, int fd);

πŸŽ€ DESCRIPTION

So the way that utempter_add_record() and addToUtmp() work is: they add a login record to the database for the TTY belonging to the pseudo-terminal master file descriptor fd, using the username corresponding with the real user ID of the calling process and the optional hostname host. Literally these functions are equivalent to ulog_login_pseudo(3), periodt ✨

Then we have utempter_remove_record() and removeLineFromUtmp(), which mark the login session as being closed for the TTY belonging to the pseudo-terminal master file descriptor fd. Those ones are equivalent to ulog_logout_pseudo(3) πŸ‘‘

And utempter_remove_added_record() and removeFromUtmp() have the same properties as the previously mentioned functions, except that they use an internally cached value of the file descriptor passed to the login functions. iykyk 🧚

Also, bestie, important detail: the pty arguments of addToUtmp() and removeLineFromUtmp() are unused. Like, they're just there vibing πŸ™ˆ

πŸ’œ RETURN VALUES

In this implementation, utempter_add_record(), utempter_remove_added_record() and utempter_remove_record() always return a value of 0. That's it, that's the return-value tea β˜•

πŸ”₯ SEE ALSO

🌈 HISTORY

These functions appeared in FreeBSD 9.0 β€” iconic behavior, honestly ⭐


mwah πŸ’‹ this page is from Debian, dated December 6, 2009, and the page title is UTEMPTER_ADD_RECORD(3) β€” bye bestie! πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from