AUDIT\_GETLOGINUID(3) Linux Audit API AUDIT\_GETLOGINUID(3)

# [NAME](#NAME)

audit\_getloginuid - Get a program's loginuid value

# [SYNOPSIS](#SYNOPSIS)

```
#include <libaudit.h>
```

```
uid_t audit_getloginuid(void);
```

# [DESCRIPTION](#DESCRIPTION)

This function returns the task attribute loginuid.

# [RETURN VALUE](#RETURN_VALUE)

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

# [ERRORS](#ERRORS)

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

# [SEE ALSO](#SEE_ALSO)

[**audit\_setloginuid**(3)](/man/os/audit/audit_setloginuid.3).

# [AUTHOR](#AUTHOR)

Steve Grubb

Oct 2006 Red Hat

---

Document: audit_getloginuid(3) from audit 4.2.1-r1 (Chainguard OS)
Source: https://github.com/linux-audit/audit-userspace
