Updated: April 19, 2023 |
Specify a different user information file
#include <utmp.h> int utmpname( const char * filename );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The utmpname() function lets you specify the name of the user information file to examine. You can change the stored name from the default file (defined in _PATH_UTMP) to any other file.
Note that this function doesn't open the new file—it just closes the old file if it's currently open and saves the new filename. If the new file doesn't exist, this won't be apparent until the first attempt to reference it is made.
0 on success, -1 on failure (errno is set).
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | No |