icon Top 9 categories map      RocketAware > man pages >


Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.

The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Search all pages


By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Integer, Floating point, Matrix, Statistics, Boolean, ...

Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


RocketLink!--> Man page versions: OpenBSD FreeBSD Solaris Others

[IEEE Std1003.1-1988 (``POSIX'').]

CUSERID(3)                OpenBSD Programmer's Manual               CUSERID(3)

     cuserid - get user name

     #include <stdio.h>

     char *
     cuserid(char *buf);

     This interface is available from the compatibility library, libcompat.

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

     If buf is not the NULL pointer, the user name is copied into the memory
     referenced by buf. The argument buf is assumed to point to an array at
     least L_cuserid (as defined in the include file <stdio.h>) bytes long.
     Otherwise, the user name is copied to a static buffer.

     If buf is not the NULL pointer, buf is returned; otherwise the address of
     the static buffer is returned.

     If the user name could not be determined, if buf is not the NULL pointer,
     the null character `\0' will be stored at *buf; otherwise the NULL point-
     er is returned.

     getlogin(2),  getpwent(3)

     The cuserid() function conforms to IEEE Std1003.1-1988 (``POSIX'').

     Due to irreconcilable differences in historic implementations, cuserid()
     was removed from the IEEE Std1003.1-1990 (``POSIX'') standard.  This im-
     plementation exists purely for compatibility with existing programs.  New
     programs should use one of the following three alternatives to obtain the
     user name:

           1.   getlogin() to return the user's login name.
           2.   getpwuid(geteuid()) to return the user name associated with
                the calling process' effective user ID.
           3.   getpwuid(getuid()) to return the user name associated with the
                calling process' real user ID.

     The cuserid() function uses getpwuid(); thus the results of a user's call
     to getpwent(), getpwnam() or getpwuid() will be overwritten by subsequent
     calls to cuserid().

OpenBSD 2.6                    November 28, 1993                             1

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.

(Corrections, notes, and links courtesy of RocketAware.com)

[Detailed Topics]
FreeBSD Sources for cuserid(3) functions

[Overview Topics]

Up to: Process Limits: Identity - Process ownership and Identity

RocketLink!--> Man page versions: OpenBSD FreeBSD Solaris Others

[IEEE Std1003.1-1988 (``POSIX'').]

Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > cuserid.3/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments