---
name: "ulog_login"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/ulog_login"
---

# ulog\_login(3)

manage user login records

## NAME

**ulog\_login**, **ulog\_login\_pseudo**, **ulog\_logout**, **ulog\_logout\_pseudo** – manage user login records

## LIBRARY

library “libulog”

## SYNOPSIS

**#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*);

## DESCRIPTION

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.

## SEE ALSO

[getuid(2)](/getuid/2.md), [posix\_openpt(2)](/posix_openpt/2.md), [ptsname(3)](/ptsname/3.md), [pututxline(3)](/pututxline/3.md)

## HISTORY

These functions appeared in FreeBSD 9.0.
