---
name: "audit_open"
section: "3"
platform: "linux"
package: "audit"
version: "4.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/audit_open"
---

# audit\_open(3)

Open a audit netlink socket connection

## NAME

audit\_open - Open a audit netlink socket connection

## SYNOPSIS

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

**int audit\_open(void);**

## 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

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

## ERRORS

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

## SEE ALSO

[**netlink**(7)](/netlink/7.md).

## AUTHOR

Steve Grubb
