---
name: "au_to_arg64"
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_to_arg"
---

# au\_to\_arg64(3)

routines for generating BSM audit tokens

Part of [au\_to\_arg(3)](/au_to_arg/3.md).

## NAME

**au\_to\_arg32**, **au\_to\_arg64**, **au\_to\_arg**, **au\_to\_attr64**, **au\_to\_data**, **au\_to\_exit**, **au\_to\_groups**, **au\_to\_newgroups**, **au\_to\_in\_addr**, **au\_to\_in\_addr\_ex**, **au\_to\_ip**, **au\_to\_ipc**, **au\_to\_ipc\_perm**, **au\_to\_iport**, **au\_to\_opaque**, **au\_to\_file**, **au\_to\_text**, **au\_to\_path**, **au\_to\_process32**, **au\_to\_process64**, **au\_to\_process**, **au\_to\_process32\_ex**, **au\_to\_process64\_ex**, **au\_to\_process\_ex**, **au\_to\_return32**, **au\_to\_return64**, **au\_to\_return**, **au\_to\_seq**, **au\_to\_sock\_inet32**, **au\_to\_sock\_inet128**, **au\_to\_sock\_inet**, **au\_to\_socket\_ex**, **au\_to\_subject32**, **au\_to\_subject64**, **au\_to\_subject**, **au\_to\_subject32\_ex**, **au\_to\_subject64\_ex**, **au\_to\_subject\_ex**, **au\_to\_me**, **au\_to\_exec\_args**, **au\_to\_exec\_env**, **au\_to\_header**, **au\_to\_header32**, **au\_to\_header64**, **au\_to\_header\_ex**, **au\_to\_header32\_ex**, **au\_to\_trailer**, **au\_to\_zonename** – routines for generating BSM audit tokens

## LIBRARY

library “libbsm”

## SYNOPSIS

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

*token\_t \**\

**au\_to\_arg32**(*char n*, *const char \*text*, *u\_int32\_t v*);

*token\_t \**\

**au\_to\_arg64**(*char n*, *const char \*text*, *u\_int64\_t v*);

*token\_t \**\

**au\_to\_arg**(*char n*, *const char \*text*, *u\_int32\_t v*);

*token\_t \**\

**au\_to\_attr32**(*struct vattr \*attr*);

*token\_t \**\

**au\_to\_attr64**(*struct vattr \*attr*);

*token\_t \**\

**au\_to\_attr**(*struct vattr \*attr*);

*token\_t \**\

**au\_to\_data**(*char unit\_print*, *char unit\_type*, *char unit\_count*, *const char \*p*);

*token\_t \**\

**au\_to\_exit**(*int retval*, *int err*);

*token\_t \**\

**au\_to\_groups**(*int \*groups*);

*token\_t \**\

**au\_to\_newgroups**(*u\_int16\_t n*, *gid\_t \*groups*);

*token\_t \**\

**au\_to\_in\_addr**(*struct in\_addr \*internet\_addr*);

*token\_t \**\

**au\_to\_in\_addr\_ex**(*struct in6\_addr \*internet\_addr*);

*token\_t \**\

**au\_to\_ip**(*struct ip \*ip*);

*token\_t \**\

**au\_to\_ipc**(*char type*, *int id*);

*token\_t \**\

**au\_to\_ipc\_perm**(*struct ipc\_perm \*perm*);

*token\_t \**\

**au\_to\_iport**(*u\_int16\_t iport*);

*token\_t \**\

**au\_to\_opaque**(*const char \*data*, *u\_int16\_t bytes*);

*token\_t \**\

**au\_to\_file**(*const char \*file*, *struct timeval tm*);

*token\_t \**\

**au\_to\_text**(*const char \*text*);

*token\_t \**\

**au\_to\_path**(*const char \*text*);

*token\_t \**\

**au\_to\_process32**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_t \*tid*);

*token\_t \**\

**au\_to\_process64**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_t \*tid*);

*token\_t \**\

**au\_to\_process32\_ex**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_addr\_t \*tid*);

*token\_t \**\

**au\_to\_process64\_ex**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_addr\_t \*tid*);

*token\_t \**\

**au\_to\_return32**(*char status*, *u\_int32\_t ret*);

*token\_t \**\

**au\_to\_return64**(*char status*, *u\_int64\_t ret*);

*token\_t \**\

**au\_to\_return**(*char status*, *u\_int32\_t ret*);

*token\_t \**\

**au\_to\_seq**(*long audit\_count*);

*token\_t \**\

**au\_to\_sock\_inet32**(*struct sockaddr\_in \*so*);

*token\_t \**\

**au\_to\_sock\_inet128**(*struct sockaddr\_in6 \*so*);

*token\_t \**\

**au\_to\_sock\_int**(*struct sockaddr\_in \*so*);

*token\_t \**\

**au\_to\_socket\_ex**(*u\_short so\_domain*, *u\_short so\_type*, *struct sockaddr \*sa\_local*, *struct sockaddr \*sa\_remote*);

*token\_t \**\

**au\_to\_subject32**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_t \*tid*);

*token\_t \**\

**au\_to\_subject64**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_t \*tid*);

*token\_t \**\

**au\_to\_subject**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_t \*tid*);

*token\_t \**\

**au\_to\_subject32\_ex**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_addr\_t \*tid*);

*token\_t \**\

**au\_to\_subject64\_ex**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_addr\_t \*tid*);

*token\_t \**\

**au\_to\_subject\_ex**(*au\_id\_t auid*, *uid\_t euid*, *gid\_t egid*, *uid\_t ruid*, *gid\_t rgid*, *pid\_t pid*, *au\_asid\_t sid*, *au\_tid\_addr\_t \*tid*);

*token\_t \**\

**au\_to\_me**(*void*);

*token\_t \**\

**au\_to\_exec\_args**(*char \*\*argv*);

*token\_t \**\

**au\_to\_exec\_env**(*char \*\*envp*);

*token\_t \**\

**au\_to\_header**(*int rec\_size*, *au\_event\_t e\_type*, *au\_emod\_t emod*);

*token\_t \**\

**au\_to\_header32**(*int rec\_size*, *au\_event\_t e\_type*, *au\_emod\_t emod*);

*token\_t \**\

**au\_to\_header64**(*int rec\_size*, *au\_event\_t e\_type*, *au\_emod\_t e\_mod*);

*token\_t \**\

**au\_to\_header\_ex**(*int rec\_size*, *au\_event\_t e\_type*, *au\_emod\_t e\_mod*);

*token\_t \**\

**au\_to\_header32\_ex**(*int rec\_size*, *au\_event\_t e\_type*, *au\_emod\_t e\_mod*);

*token\_t \**\

**au\_to\_trailer**(*int rec\_size*);

*token\_t \**\

**au\_to\_zonename**(*const char \*zonename*);

## DESCRIPTION

These interfaces support the allocation of BSM audit tokens, represented by *token\_t*, for various data types.

[au\_errno\_to\_bsm(3)](/au_errno_to_bsm/3.md) must be used to convert local [errno(2)](/errno/2.md) errors to BSM error numbers before they are passed to **au\_to\_return**(), **au\_to\_return32**(), and **au\_to\_return64**().

## RETURN VALUES

On success, a pointer to a *token\_t* will be returned; the allocated *token\_t* can be freed via a call to [au\_free\_token(3)](/au_free_token/3.md). On failure, NULL will be returned, and an error condition returned via *errno*.

## SEE ALSO

[au\_errno\_to\_bsm(3)](/au_errno_to_bsm/3.md), [libbsm(3)](/libbsm/3.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.
