Gets and sets user information about the owner of the current process.
Standard C Library (libc.a)
The usrinfo subroutine 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 the parent process.
Item | Description |
---|---|
Command | Specifies one of the following constants:
The minimum user information consists of four strings typically set by the login program:
If the process has no terminal, the TTYName parameter should be null. |
Buffer | Specifies a pointer to a user buffer. This buffer is usually UINFOSIZ bytes long. |
Count | Specifies the number of bytes of user information copied from or to the user buffer. |
If successful, the usrinfo subroutine returns a non-negative integer giving the number of bytes transferred. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The usrinfo subroutine fails if one of the following is true:
Item | Description |
---|---|
EPERM | The Command parameter is set to SETUINFO, and the calling process does not have root user authority. |
EINVAL | The Command parameter is not set to SETUINFO or GETUINFO. |
EINVAL | The Command parameter is set to SETUINFO, and the Count parameter is larger than UINFOSIZ. |
EFAULT | The Buffer parameter points outside of the address space of the process. |