endutxent() — Close the 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 endutxent(void);

General description

The endutxent() function closes the utmpx database for the current thread. The database may be opened by getutxent(), getutxid(), getutxline(), or pututxline().

Because the endutxent() function processes thread-specific data the endutxent() 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.

Programs must not reference the data passed back by getutxline(), getutxid(), getutxent(), or pututxline() after endutxent() has been called (the storage has been freed.)

After getuxline(), getutxent(), getutxid(), or pututxline(), the utmpx database is open. No other process can do pututxline() to this utmpx database until this process issues endutxent() or __utmpxname() to close the utmpx database, or this process ends. You can cause all z/OS® UNIX user logins/logouts to hang if you fail to exit() or issue endutxent() or __utmpxname(), and you have the main /etc/utmpx database open in your process. endutxent() resets the name of the next utmpx file to open back to the default. If you want to do additional utmpx operations using a nonstandard utmpx file name, you must reissue __utmpxname() after closing the utmpx database with endutxent().

Returned value

endutxent() returns no values.

Related information