AUDIT\_NAME\_TO\_ERRNO(3) Linux Audit API AUDIT\_NAME\_TO\_ERRNO(3)

# [NAME](#NAME)

audit\_name\_to\_errno, audit\_errno\_to\_name - Convert the errno name and the numeric errno value to each other

# [SYNOPSIS](#SYNOPSIS)

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

```
int audit_name_to_errno(const char *error);
```

```
const char *audit_errno_to_name(int error);
```

# [DESCRIPTION](#DESCRIPTION)

**audit\_name\_to\_errno**() converts the errno name ("EPERM", "ENOENT", "ESRCH", etc.) to the numeric errno value (EPERM, ENOENT, ESRCH, etc.). *error* is the errno name.

**audit\_errno\_to\_name**() converts the numeric errno value (EPERM, ENOENT, ESRCH, etc.) to the errno name ("EPERM", "ENOENT", "ESRCH", etc.). *error* is the numeric errno value.

# [RETURN VALUE](#RETURN_VALUE)

**audit\_name\_to\_errno**() returns 0 if an error occurs; otherwise, the return value is the numeric errno value.

**audit\_errno\_to\_name**() returns NULL if an error occurs; otherwise, the return value is the errno name.

# [AUTHOR](#AUTHOR)

Steve Grubb

Mar 2022 Red Hat

---

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