---
name: "audit_detect_machine"
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_detect_machine"
---

# audit\_detect\_machine(3)

Detects the current machine type

## NAME

audit\_detect\_machine - Detects the current machine type

## SYNOPSIS

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

**int audit\_detect\_machine(void);**

## DESCRIPTION

audit\_detect\_machine queries uname and converts the kernel machine string to an enum value defined in machine\_t. The machine type is needed for any use of the audit\_name\_to\_syscall function.

## RETURN VALUE

Returns -1 if an error occurs; otherwise, the return value is the machine's type.

## SEE ALSO

[**uname**(3)](/uname/3.md), [**audit\_name\_to\_syscall**(3)](/audit_name_to_syscall/3.md).

## AUTHOR

Steve Grubb
