ulog_login(3)

ulog_login3

Manage user login records

Usage

#include <ulog.h>

void

ulog_login(const char *line, const char *user, const char *host);

void

ulog_login_pseudo(int fd, const char *host);

void

ulog_logout(const char *line);

void

ulog_logout_pseudo(int fd);

Library

library “libulog”

Overview

The ulog_login() and ulog_login_pseudo() functions register a login session on a TTY. The ulog_login() function adds an entry for TTY line and username user. The ulog_login_pseudo() function uses file descriptor to a pseudo-terminal master device fd to determine the TTY name, while using the username belonging to the real user ID of the calling process. The optional host argument denotes a remote hostname, in case the login session is provided by a network service.

The ulog_logout() and ulog_logout_pseudo() functions mark the previously registered login session as being terminated.

Because the line and user arguments of ulog_login() and ulog_logout() cannot be trusted, these functions require administrative privileges. The ulog_login_pseudo() and ulog_logout_pseudo() functions spawn a privileged process to perform the actual logging.

Releases

34 releases since FreeBSD 9.0-RELEASE; the text changed 20 times.

  1. 9.0
  2. 9.1
  3. 9.2
  4. 9.3
  5. 10.0
  6. 10.1
  7. 10.2
  8. 10.3
  9. 10.4
  10. 11.0
  11. 11.1
  12. 11.2
  13. 11.3
  14. 11.4
  15. 12.0
  16. 12.1
  17. 12.2
  18. 12.3
  19. 12.4
  20. 13.0–13.2
  21. 13.3–16.0

History

These functions appeared in FreeBSD 9.0.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.