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

# [NAME](#NAME)

audit\_open - Open a audit netlink socket connection

# [SYNOPSIS](#SYNOPSIS)

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

```
int audit_open(void);
```

# [DESCRIPTION](#DESCRIPTION)

audit\_open creates a NETLINK\_AUDIT socket for communication with the kernel part of the Linux Audit Subsystem. The audit system uses the ACK feature of netlink. This means that every message to the kernel will return a netlink status packet even if the operation succeeds.

# [RETURN VALUE](#RETURN_VALUE)

Returns -1 if an error occurs; otherwise, the return value is a descriptor referencing the socket.

# [ERRORS](#ERRORS)

The **audit\_open**() function may fail and set *errno* for any of the errors specified for the [**socket**(2)](/man/os/audit/socket.2) and [**fcntl**(2)](/man/os/audit/fcntl.2) routines.

# [SEE ALSO](#SEE_ALSO)

[**netlink**(7)](/man/os/audit/netlink.7).

# [AUTHOR](#AUTHOR)

Steve Grubb

Oct 2006 Red Hat

---

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