]> git.lizzy.rs Git - plan9front.git/blob - sys/man/2/getuser
121fdea370a7168e431fa14b0ab2894f1c0fc7b1
[plan9front.git] / sys / man / 2 / getuser
1 .TH GETUSER 2
2 .SH NAME
3 getuser, sysname \- get user or system name
4 .SH SYNOPSIS
5 .B #include <u.h>
6 .br
7 .B #include <libc.h>
8 .PP
9 .B
10 char*   getuser(void)
11 .PP
12 .B
13 char*   sysname(void)
14 .SH DESCRIPTION
15 .I Getuser
16 returns a pointer to static data which contains the
17 null-terminated
18 name of the user who
19 owns the current process.
20 .I Getuser
21 stats the file
22 .BI /proc/ pid /status
23 to find the name.
24 .PP
25 .I Sysname
26 reads the file
27 .BR /dev/sysname ,
28 which contains the name of the machine.
29 Unlike
30 .IR getuser ,
31 .I sysname
32 caches the string, reading the file only once.
33 .SH SOURCE
34 .B /sys/src/libc/9sys/getuser.c
35 .br
36 .B /sys/src/libc/9sys/sysname.c 
37 .SH SEE ALSO
38 .IR intro (2),
39 .IR proc (3),
40 .IR cons (3)