aboutsummaryrefslogtreecommitdiff
path: root/man/man3/getuser.3
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-03 06:40:20 +0000
committerrsc <devnull@localhost>2005-01-03 06:40:20 +0000
commit058b0118a52061ad57694c01fc8763b22b789c4d (patch)
tree6685f04dea5ed68edaa34998c976aed34c55fe94 /man/man3/getuser.3
parent2600337aa704efbeba8201e88147a764b4fd2b90 (diff)
downloadplan9port-058b0118a52061ad57694c01fc8763b22b789c4d.tar.gz
plan9port-058b0118a52061ad57694c01fc8763b22b789c4d.tar.bz2
plan9port-058b0118a52061ad57694c01fc8763b22b789c4d.zip
Some man pages.
Diffstat (limited to 'man/man3/getuser.3')
-rw-r--r--man/man3/getuser.337
1 files changed, 26 insertions, 11 deletions
diff --git a/man/man3/getuser.3 b/man/man3/getuser.3
index e09c4a49..a7ada46f 100644
--- a/man/man3/getuser.3
+++ b/man/man3/getuser.3
@@ -18,20 +18,35 @@ null-terminated
name of the user who
owns the current process.
.I Getuser
-reads
-.B /dev/user
-to find the name.
+calls
+.IR getuid (2)
+and then reads
+.B /etc/passwd
+to find the corresponding name.
.PP
.I Sysname
-provides the same service for the file
-.BR #c/sysname ,
-which contains the name of the machine.
+returns a pointer to static data which contains the name
+of the machine on which the current process is running.
+.I Sysname
+looks first for an environment variable
+.BR $sysname .
+If there is no such variable,
+.I sysname
+calls
+.IR gethostname (2)
+and truncates the returned name at the first dot.
+If
+.I gethostname
+fails,
+.I sysname
+returns the default name
+.LR gnot .
+.PP
Unlike
.IR getuser ,
.I sysname
-caches the string, reading the file only once.
+caches the string, deriving the host name only once.
.SH SOURCE
-.B /usr/local/plan9/src/libc/port/getuser.c
-.SH SEE ALSO
-.IR intro (3),
-.IR cons (3)
+.B /usr/local/plan9/src/lib9/getuser.c
+.br
+.B /usr/local/plan9/src/lib9/sysname.c