Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getuinfo

login



USRINFO(2,L)                AIX Technical Reference                USRINFO(2,L)



-------------------------------------------------------------------------------
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 information 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 parameter.

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




Processed November 7, 1990       USRINFO(2,L)                                 1





USRINFO(2,L)                AIX Technical Reference                USRINFO(2,L)



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.

ERROR CONDITIONS

The usrinfo system call fails if one or more of the following are true:

EPERM   The cmd parameter is set to SETUINFO and the effective user ID of the
        process is not superuser.

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.

EFAULT  The buf parameter points to a location outside of the process's
        allocated address space.

RELATED INFORMATION

In this book:  "getuinfo."

The login command in AIX Operating System Commands Reference.































Processed November 7, 1990       USRINFO(2,L)                                 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026