PreviousNext

dce_aud_set_trail_size_limit(3sec)

Sets a limit to the audit trail size.

Used by client/server applications.

Synopsis

#include<dce/audit.h>

void dce_aud_set_trail_size_limit(
dce_aud_trail_t at,
unsigned32 file_size_limit_value,
unsigned32 *status)

Parameters

Input

at
A pointer to the descriptor of an audit trail file previously opened for reading by the function dce_aud_open( ).

file_size_limit_value
The desired maximum size of the audit trail file, in bytes.

Output

status
Returns the status code of this routine. This status code indicates whether the routine completed successfully or not. If the routine did not complete successfully, the reason for the failure is given.

Description
The dce_aud_set_trail_size_limit( ) function can be used by an application that links with libaudit to set the maximum size of the audit trail. This function must be called immediately after calling dce_aud_open( ).

For added flexibility, the environment variable DCEAUDITTRAILSIZE can also be used to set the maximum trail size limit.

If none of these methods are used for setting the trail size, then a hardcoded limit of 2 megabytes will be assumed.

If set, the value of the environment variable DCEAUDITTRAILSIZE overrides the value set by this function. Any of the values set by DCEAUDITTRAILSIZE or this function overrides the hardcoded default.

When the size limit is reached, the current trail file is copied to another file. The name of this new file is the original file name appended by a timestamp. For example, if the name of the original trail file is central_trail, its companion trail file is named central_trail.md_index. These two files will be copied to:

central_trail.1994-09-26-16-38-15
and

central_trail.1994-09-26-16-38-15.md_index.

When a trail file is copied to a new file by the audit library because it has reached the size limit, a serviceability message is issued to the console notifying the user that an audit trail file (and its companion index file) is available to be backed up. Once the backup is performed, it is advisable to remove the old trail file, so as to prevent running out of disk space.

Auditing will then continue, using the original name of the file, (in our example, central_trail).

Return Values
No value is returned.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

aud_s_invalid_trail_descriptor
The audit trail descriptor at is null.

aud_s_ok
The call is successful.

Related Information
Function: dce_aud_open(3sec)