UTEMPTER_ADD_RECORD(3)
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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2009 Ed Schouten <ed@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms