xref: /illumos-gate/usr/src/man/man3c/cuserid.3c (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
te
Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
CUSERID 3C "Dec 30, 1996"
NAME
cuserid - get character login name of the user
SYNOPSIS

#include <stdio.h>

char *cuserid(char *s);
DESCRIPTION

The cuserid() function generates a character-string representation of the login name under which the owner of the current process is logged in. If s is a null pointer, this representation is generated in an internal static area whose address is returned. Otherwise, s is assumed to point to an array of at least L_cuserid characters; the representation is left in this array. The constant L_cuserid is defined in the <stdio.h> header.

In multithreaded applications, the caller must always supply an array s for the return value.

RETURN VALUES

If the login name cannot be found, cuserid() returns a null pointer. If s is not a null pointer, the null character `\e0' will be placed at s[0].

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe
SEE ALSO

getlogin (3C), getpwnam (3C), attributes (7)