getuser 641 B

12345678910111213141516171819202122232425262728293031323334353637
  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. reads
  22. .B /dev/user
  23. to find the name.
  24. .PP
  25. .I Sysname
  26. provides the same service for the file
  27. .BR #c/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/port/getuser.c
  35. .SH SEE ALSO
  36. .IR intro (2),
  37. .IR cons (3)