Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
GETUSER(3)		   Library Functions Manual		    GETUSER(3)

NAME
       getuser,	sysname	- get user or system name

SYNOPSIS
       #include	<u.h>
       #include	<libc.h>

       char*	 getuser(void)

       char*	 sysname(void)

DESCRIPTION
       Getuser returns a pointer to static data	which contains the null-termi-
       nated name of the user who owns the  current  process.	Getuser	 calls
       getuid(2) and then reads	/etc/passwd to find the	corresponding name.

       Sysname returns a pointer to static data	which contains the name	of the
       machine on which	the current process is running.	 Sysname  looks	 first
       for  an	environment  variable $sysname.	 If there is no	such variable,
       sysname calls gethostname(2) and	truncates the  returned	 name  at  the
       first dot.  If gethostname fails, sysname returns the default name

       Unlike  getuser,	sysname	caches the string, deriving the	host name only
       once.

SOURCE
       /usr/local/plan9/src/lib9/getuser.c
       /usr/local/plan9/src/lib9/sysname.c

								    GETUSER(3)

NAME | SYNOPSIS | DESCRIPTION | SOURCE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=getuser&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help