GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GETUSER(3) FreeBSD Library Functions Manual GETUSER(3)

getuser, sysname - get user or system name

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

char* getuser(void)

char* sysname(void)

Getuser returns a pointer to static data which contains the null-terminated name of the user who owns the current process. Getuser calls 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 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.

/src/lib9/getuser.c
/src/lib9/sysname.c

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.