Module: OsCtld::Mount::Sys

Defined in:
lib/osctld/mount/sys.rb

Defined Under Namespace

Modules: Int

Class Method Summary collapse

Class Method Details

.bind_mount(src, dst) ⇒ Object

Raises:

  • (SystemCallError)


27
28
29
30
31
# File 'lib/osctld/mount/sys.rb', line 27

def self.bind_mount(src, dst)
  ret = Int.mount(src, dst, 0, Int::MS_MGC_VAL | Int::MS_BIND, 0)
  raise SystemCallError, Fiddle.last_error if ret != 0
  ret
end

.move_mount(src, dst) ⇒ Object

Raises:

  • (SystemCallError)


21
22
23
24
25
# File 'lib/osctld/mount/sys.rb', line 21

def self.move_mount(src, dst)
  ret = Int.mount(src, dst, 0, Int::MS_MGC_VAL | Int::MS_MOVE, 0)
  raise SystemCallError, Fiddle.last_error if ret != 0
  ret
end

.unmount(mountpoint) ⇒ Object

Raises:

  • (SystemCallError)


33
34
35
36
37
# File 'lib/osctld/mount/sys.rb', line 33

def self.unmount(mountpoint)
  ret = Int.umount2(mountpoint, 0) # force unmount returns EACCESS
  raise SystemCallError, Fiddle.last_error if ret != 0
  ret
end