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]
#include <stdio.h> char *cuserid(char *s);
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.
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].
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
MT-Level MT-Safe |
getlogin (3C), getpwnam (3C), attributes (7)