Skip to content

Commit

Permalink
Merge pull request #36 from tklauser/freebsd-x-sys-unix
Browse files Browse the repository at this point in the history
mount: use MNT_* flags from golang.org/x/sys/unix on freebsd
  • Loading branch information
cpuguy83 committed Sep 23, 2020
2 parents bbb236c + 2fa84b5 commit 4a8c65a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
17 changes: 7 additions & 10 deletions mount/flags_freebsd.go
@@ -1,28 +1,25 @@
// +build freebsd,cgo
// +build freebsd

package mount

/*
#include <sys/mount.h>
*/
import "C"
import "golang.org/x/sys/unix"

const (
// RDONLY will mount the filesystem as read-only.
RDONLY = C.MNT_RDONLY
RDONLY = unix.MNT_RDONLY

// NOSUID will not allow set-user-identifier or set-group-identifier bits to
// take effect.
NOSUID = C.MNT_NOSUID
NOSUID = unix.MNT_NOSUID

// NOEXEC will not allow execution of any binaries on the mounted file system.
NOEXEC = C.MNT_NOEXEC
NOEXEC = unix.MNT_NOEXEC

// SYNCHRONOUS will allow any I/O to the file system to be done synchronously.
SYNCHRONOUS = C.MNT_SYNCHRONOUS
SYNCHRONOUS = unix.MNT_SYNCHRONOUS

// NOATIME will not update the file access time when reading from a file.
NOATIME = C.MNT_NOATIME
NOATIME = unix.MNT_NOATIME
)

// These flags are unsupported.
Expand Down
2 changes: 1 addition & 1 deletion mount/flags_unsupported.go
@@ -1,4 +1,4 @@
// +build !linux,!freebsd freebsd,!cgo
// +build !linux,!freebsd

package mount

Expand Down
2 changes: 1 addition & 1 deletion mount/go.mod
Expand Up @@ -4,5 +4,5 @@ go 1.14

require (
github.com/moby/sys/mountinfo v0.1.0
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860
)
4 changes: 2 additions & 2 deletions mount/go.sum
@@ -1,4 +1,4 @@
github.com/moby/sys/mountinfo v0.1.0 h1:r8vMRbMAFEAfiNptYVokP+nfxPJzvRuia5e2vzXtENo=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860 h1:YEu4SMq7D0cmT7CBbXfcH0NZeuChAXwsHe/9XueUO6o=
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

0 comments on commit 4a8c65a

Please sign in to comment.