usrinfo
Purpose
Gets and sets user information about the owner of the
calling process.
Syntax
#include <uinfo.h>
int usrinfo (cmd, buf, count)
int cmd;
char *buf;
int count;
Description
The usrinfo system call gets and sets information about
the owner of the current process. The information is a
sequence of null-terminated name=value strings. The last
string in the sequence is terminated by two successive
null characters. A child process inherits the user
information of its parent.
The buf parameter is a pointer to a user buffer. This
buffer is usually UINFOSIZ bytes long.
The count parameter is the number of bytes of user infor-
mation to be copied from or to the user buffer.
If the cmd parameter is one of the following constants:
GETUINFO Copies up to count bytes of user information
into the buffer pointed to by the buf param-
eter.
SETUINFO Sets the user information for the process to
the first count bytes in the buffer pointed
to by the buf parameter. The effective user
ID of the calling process must be superuser
to set the user information.
The user information should at minimum consist of three
strings that are typically set by the login program.
These three strings are:
NAME=username
UID=userid
TTY=ttyname
If the process has no terminal, ttyname should be null.
Return Value
Upon successful completion, a nonnegative integer giving
the number of bytes transferred is returned. If the
usrinfo system call fails, a value of -1 is returned and
errno is set to indicate the error.
Diagnostics
The usrinfo system call fails if one or more of the fol-
lowing are true:
EPERM The cmd parameter is set to SETUINFO and the
effective user ID of the process is not super-
user.
EINVAL The cmd parameter is not set to SETUINFO or
GETUINFO.
EINVAL The cmd parameter is set to SETUINFO and the
count parameter is larger than UINFOSIZ.
EINVAL The cmd parameter is SETUINFO and buf does not
contain a NAME= entry.
EFAULT The buf parameter &pointsout..
Related Information
In this book: "getuinfo."
The login command in AIX Operating System Commands Refer-
ence.