HP-UX Reference (11i v2 04/09) - 2 System Calls (vol 5)

a
audctl(2) audctl(2)
there is no available "next" file, no action is performed;
-1 is returned, and
errno is set to ENOENT.
AUD_OFF The caller issues the AUD_OFF command to halt the auditing system. If the
auditing system is on, it is turned off and the "current" and "next" audit files
are closed. cpath , npath , and mode are ignored. If the audit system is
already off,
-1 is returned and
errno is set to EALREADY.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise,
-1 is returned and the global variable
errno is set to indicate the error.
EXAMPLES
In the following example,
audctl() is used to determine whether the auditing system is on, and to
retrieve the names of the audit files that are currently in use by the system.
char c_file[PATH_MAX+1], x_file[PATH_MAX+1];
int mode=0600;
if (audctl(AUD_GET, c_file, x_file, mode))
switch ( errno ) {
case ENOENT:
strcpy(x_file,"-none-");
break;
case EALREADY:
printf("The auditing system is OFF\n");
return 0;
case default:
fprintf(stderr, "Audctl failed: errno=%d\n", errno);
return 1;
}
printf("The auditing system is ON: c_file=%s x_file=%s\n",
c_file, x_file);
return 0;
ERRORS
audctl() fails if one of the following is true:
[EPERM] The caller does not have superuser privilege, or one or both of the given files
are not regular files and cannot be used.
[EALREADY] The AUD_OFF, AUD_SET, AUD_SETCURR, AUD_SETNEXT, AUD_SWITCH,or
AUD_GET cmd was specified while the auditing system is off.
[EBUSY] User attempt to start the auditing system failed because auditing is already
on.
[EFAULT] Bad pointer. One or more of the required function parameters is not accessi-
ble.
[EINVAL] The cpath or npath is greater than PATH_MAX in length, the cpath or npath
specified is not an absolute path name.
[ENOENT] No available "next" file when cmd is AUD_GETNEXT or AUD_SWITCH.
AUTHOR
audctl() was developed by HP.
SEE ALSO
audit(5), audsys(1M), audomon(1M).
HP-UX 11i Version 2: September 2004 2 Hewlett-Packard Company Section 229