cuserid()

generate character representation of name associated with user ID 

Function


SYNOPSIS

#include <stdio.h>

char *cuserid(char *s);


DESCRIPTION

The cuserid() function generates a character representation of the name associated with the effective user ID of the process.

If s is a null pointer, this representation is generated in an area that may be static (and thus overwritten by subsequent calls to cuserid()), the address of which is returned. If s is not a null pointer, s is assumed to point to an array of at least L_cuserid bytes; the representation is deposited in this array.

A multithreaded application must not call cuserid() with a null pointer.


PARAMETERS

s 

Specifies the buffer where the user name is stored, or null if an internal buffer should be used.


RETURN VALUES

If s is not a null pointer, s is returned. If s is not a null pointer and the login name cannot be determined, the null byte '\0' is placed at *s. If s is a null pointer and the login name cannot be found, cuserid() returns a null pointer. If s is a null pointer and the login name can be found, the address of a buffer (possibly static) containing the login name is returned.


CONFORMANCE

UNIX 98


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

This function is only MT-Safe if its parameter is non-NULL.


PORTING ISSUES

This interface is obsolescent; getpwuid() should be used instead.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
geteuid(), getlogin(), getpwnam(), getpwuid(), getuid()


PTC MKS Toolkit 10.5 Documentation Build 40.