unix.go 781 B

1234567891011121314151617181920212223242526
  1. //go:build !windows && !plan9 && !js
  2. // Package unix exports an Elvish namespace that contains variables and
  3. // functions that deal with features unique to UNIX-like operating systems. On
  4. // non-UNIX operating systems it exports an empty namespace.
  5. package unix
  6. import (
  7. "src.elv.sh/pkg/eval"
  8. "src.elv.sh/pkg/eval/vars"
  9. "src.elv.sh/pkg/logutil"
  10. )
  11. // ExposeUnixNs indicate whether this module should be exposed as a usable
  12. // elvish namespace.
  13. const ExposeUnixNs = true
  14. // Ns is an Elvish namespace that contains variables and functions that deal
  15. // with features unique to UNIX-like operating systems. On
  16. var Ns = eval.BuildNs().
  17. AddVars(map[string]vars.Var{
  18. "umask": UmaskVariable{},
  19. "rlimits": rlimitsVar{},
  20. }).Ns()
  21. var logger = logutil.GetLogger("[mods/unix] ")