setutxent() — Reset to start of utmpx database

Standards

Standards / Extensions C or C++ Dependencies

XPG4.2
Single UNIX Specification, Version 3

both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <utmpx.h>

void setutxent(void);

General description

The setutxent() function resets the input to the beginning of the utmpx database opened by previous calls to getutxid(), getutxent(), getutxline(), or pututxline() calls from the current thread. This should be done before each getutxid() and getutxline() search for a new entry if it is desired that the entire database be examined.

Because the setutxent() function processes thread-specific data the setutxent() function can be used safely from a multithreaded application. If multiple threads in the same process open the database, then each thread opens the database with a different file descriptor. The thread's database file descriptor is closed when the calling thread terminates or the endutxent() function is called by the calling thread.

Returned value

setutxent() returns no values.

Related information