diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-23 02:31:28 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-23 02:31:28 +0100 |
commit | dced7255ec86587b441dc2ac04a8fb268ac5b920 (patch) | |
tree | a5e5a37ea4729605a200cc7659d720a80802e1d6 /sys/man/2 | |
parent | 2e6a5e704646109a7aaf7dd5a9d3a64475fd0055 (diff) |
libc: re-implement getuser() by stating /proc/$pid/status
The idea is to avoid the magic files that contain
per process information in devcons when possible.
It will make it easier to deprecate them in the future.
Diffstat (limited to 'sys/man/2')
-rw-r--r-- | sys/man/2/getuser | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/man/2/getuser b/sys/man/2/getuser index e5aed07a6..121fdea37 100644 --- a/sys/man/2/getuser +++ b/sys/man/2/getuser @@ -18,22 +18,23 @@ null-terminated name of the user who owns the current process. .I Getuser -reads -.B /dev/user +stats the file +.BI /proc/ pid /status to find the name. .PP .I Sysname -provides the same service for the file -.BR #c/sysname , +reads the file +.BR /dev/sysname , which contains the name of the machine. Unlike .IR getuser , .I sysname caches the string, reading the file only once. .SH SOURCE -.B /sys/src/libc/port/getuser.c +.B /sys/src/libc/9sys/getuser.c .br .B /sys/src/libc/9sys/sysname.c .SH SEE ALSO .IR intro (2), +.IR proc (3), .IR cons (3) |