[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


auditpack Subroutine

Purpose

Compresses and uncompresses audit bins.

Library

Security Library (libc.a)

Syntax

#include <sys/audit.h>
#include <stdio.h>


char *auditpack ( Expand Buffer)
int Expand;
char *Buffer;

Description

The auditpack subroutine can be used to compress or uncompress bins of audit records.

Parameters


Expand Specifies the operation. Valid values, as defined in the sys/audit.h header file, are one of the following:

AUDIT_PACK
Performs standard compression on the audit bin.

AUDIT_UNPACK
Unpacks the compressed audit bin.
Buffer Specifies the buffer containing the bin to be compressed or uncompressed. This buffer must contain a standard bin as described in the audit.h file.

Return Values

If the auditpack subroutine is successful, a pointer to a buffer containing the processed audit bin is returned. If unsuccessful, a null pointer is returned and the errno global variable is set to indicate the error.

Error Codes

The auditpack subroutine fails if one or more of the following values is true:

EINVAL The Expand parameter is not one of the valid values (AUDIT_PACK or AUDIT_UNPACK).
EINVAL The Expand parameter is AUDIT_UNPACK and the packed data in Buffer does not unpack to its original size.
EINVAL The Expand parameter is AUDIT_PACK and the bin in the Buffer parameter is already compressed, or the Expand parameter is AUDIT_UNPACK and the bin in the Buffer parameter is already unpacked.
ENOSPC The auditpack subroutine is unable to allocate space for a new buffer.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The auditread (auditread, auditread_r Subroutines) subroutine.

The auditcat command.

List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]