DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

getluid(S-osr5)


getluid -- get login user ID

Syntax

cc . . . -lprot

#include  <sys/types.h>
#include  <sys/security.h>
#include  <sys/audit.h>
#include  <prot.h>

int getluid ()

Description

The getluid routine returns the login user ID for the process.

The login user ID, or LUID, is set at login or batch start time; once set, it cannot be changed. The LUID, an accurate representation of the user who logged into the system, cannot be altered during the session. The LUID is needed because both the effective and real user IDs can be altered by use of setuid(S-osr5) or by setting the setuid bits on an executable file, and consequently, at times during a session, do not accurately reflect the login user.

Return value

Upon successful completion the LUID is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

Diagnostics

If the following condition occurs, getluid fails and errno is set to the corresponding value:

[EPERM] 10
The login user ID has not yet been set for the process.

See also

getuid(S-osr5), setluid(S-osr5), setuid(S-osr5), stat(S-osr5)

Standards conformance

The getluid routine is an extension of AT&T System V provided by the Santa Cruz Operation.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005