audit_get_session(3)

audit_get_session3

Get a program's login session id value

Usage

#include <libaudit.h>

uint32_t audit_get_session(void);

Overview

This function returns the task's session id attribute.

Return value

This function returns the session id value if it was set. It will return a -1 if the session id is unset. However, since uint32_t is an unsigned type, you will see the converted value instead of -1.

Errors

This function returns -2 on failure. Additionally, in the event of a real error, errno would be set. The function can set errno based on failures of open, read, or strtoul.

Releases

5 releases since Debian 10 (Buster); the text changed 1 time.

  1. 10–13
  2. Arch

Author

Steve Grubb

From audit 4.2.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.