---
name: "addToUtmp"
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/addToUtmp"
---

# addToUtmp(3)

utempter compatibility interface

## NAME

**utempter\_add\_record**, **utempter\_remove\_added\_record**, **utempter\_remove\_record**, **addToUtmp**, **removeFromUtmp**, **removeLineFromUtmp** – utempter compatibility interface

## LIBRARY

library “libulog”

## SYNOPSIS

**#include \<utempter.h\>**

*int*\

**utempter\_add\_record**(*int fd*, *const char \*host*);

*int*\

**utempter\_remove\_added\_record**(*void*);

*int*\

**utempter\_remove\_record**(*int fd*);

*void*\

**addToUtmp**(*const char \*pty*, *const char \*host*, *int fd*);

*void*\

**removeFromUtmp**(*void*);

*void*\

**removeLineFromUtmp**(*const char \*pty*, *int fd*);

## DESCRIPTION

The **utempter\_add\_record**() and **addToUtmp**() functions add a login record to the database for the TTY belonging to the pseudo-terminal master file descriptor *fd*, using the username corresponding with the real user ID of the calling process and the optional hostname *host*. These functions are equivalent to [ulog\_login\_pseudo(3)](/ulog_login_pseudo/3.md).

The **utempter\_remove\_record**() and **removeLineFromUtmp**() functions mark the login session as being closed for the TTY belonging to the pseudo-terminal master file descriptor *fd*. These functions are equivalent to [ulog\_logout\_pseudo(3)](/ulog_logout_pseudo/3.md).

The **utempter\_remove\_added\_record**() and **removeFromUtmp**() functions have the same properties as the previously mentioned functions, except that they use an internally cached value of the file descriptor passed to the login functions.

The *pty* arguments of **addToUtmp**() and **removeLineFromUtmp**() are unused.

## RETURN VALUES

In this implementation, the **utempter\_add\_record**(), **utempter\_remove\_added\_record**() and **utempter\_remove\_record**() always return a value of 0.

## SEE ALSO

[pututxline(3)](/pututxline/3.md), [ulog\_login\_pseudo(3)](/ulog_login_pseudo/3.md)

## HISTORY

These functions appeared in FreeBSD 9.0.
