---
name: "au_class"
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_class"
---

# au\_class(3)

look up information from the audit\_class database

## NAME

**getauclassent**, **getauclassent\_r**, **getauclassnam**, **getauclassnam\_r**, **setauclass**, **endauclass** – look up information from the audit\_class database

## LIBRARY

library “libbsm”

## SYNOPSIS

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

*struct au\_class\_ent \**\

**getauclassent**(*void*);

*struct au\_class\_ent \**\

**getauclassent\_r**(*struct au\_class\_ent \*e*);

*struct au\_class\_ent \**\

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

*struct au\_class\_ent \**\

**getauclassnam\_r**(*struct au\_class\_ent \*e*, *const char \*name*);

*void*\

**setauclass**(*void*);

*void*\

**endauclass**(*void*);

## DESCRIPTION

These interfaces may be used to look up information from the [audit\_class(5)](/audit_class/5.md) database, which describes audit event classes. Audit event classes are described by *struct au\_class\_ent*.

The **getauclassent**() function will return the next class found in the [audit\_class(5)](/audit_class/5.md) database, or the first if the function has not yet been called. NULL will be returned if no further records are available.

The **getauclassnam**() function looks up a class by name. NULL will be returned if no matching class can be found.

The **setauclass**() function resets the iterator through the [audit\_class(5)](/audit_class/5.md) database, causing the next call to **getauclassent**() to start again from the beginning of the file.

The **endauclass**() function closes the [audit\_class(5)](/audit_class/5.md) database, if open.

## SEE ALSO

[libbsm(3)](/libbsm/3.md), [audit\_class(5)](/audit_class/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

These routines cannot currently distinguish between an entry not being found and an error accessing the database. The implementation should be changed to return an error via *errno* when NULL is returned.
