flags_linux.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package mount
  2. import (
  3. "syscall"
  4. )
  5. const (
  6. // RDONLY will mount the file system read-only.
  7. RDONLY = syscall.MS_RDONLY
  8. // NOSUID will not allow set-user-identifier or set-group-identifier bits to
  9. // take effect.
  10. NOSUID = syscall.MS_NOSUID
  11. // NODEV will not interpret character or block special devices on the file
  12. // system.
  13. NODEV = syscall.MS_NODEV
  14. // NOEXEC will not allow execution of any binaries on the mounted file system.
  15. NOEXEC = syscall.MS_NOEXEC
  16. // SYNCHRONOUS will allow I/O to the file system to be done synchronously.
  17. SYNCHRONOUS = syscall.MS_SYNCHRONOUS
  18. // DIRSYNC will force all directory updates within the file system to be done
  19. // synchronously. This affects the following system calls: create, link,
  20. // unlink, symlink, mkdir, rmdir, mknod and rename.
  21. DIRSYNC = syscall.MS_DIRSYNC
  22. // REMOUNT will attempt to remount an already-mounted file system. This is
  23. // commonly used to change the mount flags for a file system, especially to
  24. // make a readonly file system writeable. It does not change device or mount
  25. // point.
  26. REMOUNT = syscall.MS_REMOUNT
  27. // MANDLOCK will force mandatory locks on a filesystem.
  28. MANDLOCK = syscall.MS_MANDLOCK
  29. // NOATIME will not update the file access time when reading from a file.
  30. NOATIME = syscall.MS_NOATIME
  31. // NODIRATIME will not update the directory access time.
  32. NODIRATIME = syscall.MS_NODIRATIME
  33. // BIND remounts a subtree somewhere else.
  34. BIND = syscall.MS_BIND
  35. // RBIND remounts a subtree and all possible submounts somewhere else.
  36. RBIND = syscall.MS_BIND | syscall.MS_REC
  37. // UNBINDABLE creates a mount which cannot be cloned through a bind operation.
  38. UNBINDABLE = syscall.MS_UNBINDABLE
  39. // RUNBINDABLE marks the entire mount tree as UNBINDABLE.
  40. RUNBINDABLE = syscall.MS_UNBINDABLE | syscall.MS_REC
  41. // PRIVATE creates a mount which carries no propagation abilities.
  42. PRIVATE = syscall.MS_PRIVATE
  43. // RPRIVATE marks the entire mount tree as PRIVATE.
  44. RPRIVATE = syscall.MS_PRIVATE | syscall.MS_REC
  45. // SLAVE creates a mount which receives propagation from its master, but not
  46. // vice versa.
  47. SLAVE = syscall.MS_SLAVE
  48. // RSLAVE marks the entire mount tree as SLAVE.
  49. RSLAVE = syscall.MS_SLAVE | syscall.MS_REC
  50. // SHARED creates a mount which provides the ability to create mirrors of
  51. // that mount such that mounts and unmounts within any of the mirrors
  52. // propagate to the other mirrors.
  53. SHARED = syscall.MS_SHARED
  54. // RSHARED marks the entire mount tree as SHARED.
  55. RSHARED = syscall.MS_SHARED | syscall.MS_REC
  56. // RELATIME updates inode access times relative to modify or change time.
  57. RELATIME = syscall.MS_RELATIME
  58. // STRICTATIME allows to explicitly request full atime updates. This makes
  59. // it possible for the kernel to default to relatime or noatime but still
  60. // allow userspace to override it.
  61. STRICTATIME = syscall.MS_STRICTATIME
  62. mntDetach = syscall.MNT_DETACH
  63. )