env 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .TH ENV 3
  2. .SH NAME
  3. env \- environment variables
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind #e /env
  7. .BI /env/ var1
  8. .BI /env/ var2
  9. ...
  10. .fi
  11. .SH DESCRIPTION
  12. The
  13. .I env
  14. device serves a one-level directory containing files with arbitrary names
  15. and contents.
  16. The intention is that the file name is the name of an
  17. .I environment variable
  18. (see
  19. .IR rc (1)),
  20. and the content is the variable's current value.
  21. .PP
  22. When a
  23. .IR fork (2)
  24. system call creates a new process, both the parent and the
  25. child continue to see exactly the same files in the
  26. .I env
  27. device: changes made in either process can be noticed by the other.
  28. In contrast, an
  29. .B rfork
  30. system call with the
  31. .B RFENVG
  32. bit set (see
  33. .IR fork (2))
  34. causes a split: initially both process groups see the
  35. same environment files, but any changes made in one process group
  36. cannot be noticed by the other.
  37. An
  38. .B rfork
  39. with
  40. .B RFCENVG
  41. splits and then clears the environment.
  42. .PP
  43. The special global environment
  44. .B #ec
  45. contains kernel configuration variables,
  46. such as those set in
  47. .IR plan9.ini (8).
  48. All processes see the same
  49. .BR #ec ;
  50. its contents are writable only by the host owner.
  51. [XXX actually everything is world writable; that's a mistake.]
  52. .SH SEE ALSO
  53. .IR rc (1),
  54. .IR fork (2),
  55. .B #c/reboot
  56. in
  57. .IR cons (3),
  58. .IR plan9.ini (8)
  59. .SH SOURCE
  60. .B /sys/src/9/port/devenv.c
  61. .SH BUGS
  62. A write starting at an offset after the current extent of a file
  63. yields an error instead of zero filling.