Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


setauduser — start auditing the current process as owned by a given user


#include <sys/audit.h>

int setauduser(const char *user, const char *stime);


setauduser() sets audit tag which uniquely identifies the user for the current process. The user argument points to the name of the login user associated with the current process, and must not exceed the longest user name that HP-UX supports. sysconf(_SC_LOGIN_NAME_MAX) can be used to dynamically get the longest user name that HP-UX supports.

The stime argument points to time of authentication in the format YYYYMMDDhhmm, Coordinated Universal Time (UTC). If stime is a null pointer, the UTC of the current time is used.

Programs using this routine must be compiled with -lsec.

Security Restrictions

This call requires the user to be superuser or to possess the SELFAUDIT privilege. See privileges(5) for details.


setauduser() returns the following values:


Successful completion. n is the length of audit tag accepted by the kernel.


Failure. errno is set to indicate the error.


If setauduser fails, errno is set to one of the following values:


user is NULL, or the length of user exceeds the longest user name that HP-UX supports.


The length of stime is not equal to MAX_TIME_LEN bytes. See <sys/audit.h>.


The caller is not a superuser or a privileged process.


setauduser() was developed by HP.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.