---
name: "getauevnum"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/au_event"
---

# getauevnum(3)

look up information from the audit\_event database

Part of [au\_event(3)](/au_event/3.md).

## NAME

**free\_au\_event\_ent**, **setauevent**, **endauevent**, **getauevent**, **getauevent\_r**, **getauevnam**, **getauevnam\_r**, **getauevnum**, **getauevnum\_r**, **getauevnonam**, **getauevnonam\_r** – look up information from the audit\_event database

## LIBRARY

library “libbsm”

## SYNOPSIS

**#include \<bsm/libbsm.h\>**

*void*\

**setauevent**(*void*);

*void*\

**endauevent**(*void*);

*struct au\_event\_ent \**\

**getauevent**(*void*);

*struct au\_event\_ent \**\

**getauevent\_r**(*struct au\_event\_ent \*e*);

*struct au\_event\_ent \**\

**getauevnam**(*const char \*name*);

*struct au\_event\_ent \**\

**getauevnam\_r**(*struct au\_event\_ent \*e*, *const char \*name*);

*struct au\_event\_ent \**\

**getauevnum**(*au\_event\_t event\_number*);

*struct au\_event\_ent \**\

**getauevnum\_r**(*struct au\_event\_ent \*e*, *au\_event\_t event\_number*);

*au\_event\_t \**\

**getauevnonam**(*const char \*event\_name*);

*au\_event\_t \**\

**getauevnonam\_r**(*au\_event\_t \*ev*, *const char \*event\_name*);

## DESCRIPTION

These interfaces may be used to look up information from the [audit\_event(5)](/audit_event/5.md) database, which describes audit events. Entries in the database are described by *struct au\_event\_ent* entries, which are returned by calls to **getauevent**(), **getauevnam**(), or **getauevnum**(). It is also possible to look up an event number via a call to **getauevnonam**().

The **setauevent**() function resets the database access session for [audit\_event(5)](/audit_event/5.md), so that the next call to **getauevent**() will start with the first entry in the database.

The **endauevent**() function closes the [audit\_event(5)](/audit_event/5.md) database session.

The **getauevent**() function returns a reference to the next entry in the [audit\_event(5)](/audit_event/5.md) database.

The **getauevnam**() function returns a reference to the entry in the [audit\_event(5)](/audit_event/5.md) database with a name of *name*.

**getauevnum**() returns a reference to the entry in the [audit\_event(5)](/audit_event/5.md) database with an event number of *event\_number*.

The **getauevnonam**() function returns a reference to an audit event number using the [audit\_event(5)](/audit_event/5.md) database.

## RETURN VALUES

Functions **getauevent**(), **getauevent\_r**(), **getauevnam**(), **getauevnam\_r**(), **getauevnum**(), **getauevnum\_r**(), and **getauevnonam**() will return a reference to a *struct au\_event\_ent* or *au\_event\_t* on success, or NULL on failure, with *errno* set to provide further error information.

## SEE ALSO

[libbsm(3)](/libbsm/3.md), [audit\_event(5)](/audit_event/5.md)

## HISTORY

The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution.

## AUTHORS

This software was created by Robert Watson, Wayne Salamon, and Suresh Krishnaswamy for McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer, Inc.

The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems.

## BUGS

The *errno* variable is not always properly set following a failure.

These routines are thread-safe, but not re-entrant, so simultaneous or interleaved use of these functions will affect the iterator.
