2014-01-31 05:16:42 -05:00
|
|
|
// +build amd64
|
|
|
|
|
2013-12-18 19:42:49 -05:00
|
|
|
package mount
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func mount(device, target, mType string, flag uintptr, data string) error {
|
2014-01-14 17:28:19 -05:00
|
|
|
if err := syscall.Mount(device, target, mType, flag, data); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we have a bind mount or remount, remount...
|
|
|
|
if flag&syscall.MS_BIND == syscall.MS_BIND && flag&syscall.MS_RDONLY == syscall.MS_RDONLY {
|
|
|
|
return syscall.Mount(device, target, mType, flag|syscall.MS_REMOUNT, data)
|
|
|
|
}
|
|
|
|
return nil
|
2013-12-18 19:42:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func unmount(target string, flag int) error {
|
|
|
|
return syscall.Unmount(target, flag)
|
|
|
|
}
|