mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-04 08:07:19 -04:00
unix: add MNT_* flags on OpenBSD
Now that all BSDs define MNT_NOWAIT, use it in TestGetfsstat instead of the locally defined copy. Change-Id: Ib6cee08a6d3a034464c7b79591605b49889a46ae Reviewed-on: https://go-review.googlesource.com/137195 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
90868a75fe
commit
b09afc3d57
@@ -292,6 +292,7 @@ includes_OpenBSD='
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -440,6 +441,7 @@ ccflags="$@"
|
|||||||
$2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ ||
|
$2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ ||
|
||||||
$2 ~ /^HW_MACHINE$/ ||
|
$2 ~ /^HW_MACHINE$/ ||
|
||||||
$2 ~ /^SYSCTL_VERS/ ||
|
$2 ~ /^SYSCTL_VERS/ ||
|
||||||
|
$2 !~ "MNT_BITS" &&
|
||||||
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
|
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
|
||||||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
||||||
$2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ ||
|
$2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ ||
|
||||||
|
|||||||
@@ -15,18 +15,14 @@ import (
|
|||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
const MNT_WAIT = 1
|
|
||||||
const MNT_NOWAIT = 2
|
|
||||||
|
|
||||||
func TestGetfsstat(t *testing.T) {
|
func TestGetfsstat(t *testing.T) {
|
||||||
const flags = MNT_NOWAIT // see golang.org/issue/16937
|
n, err := unix.Getfsstat(nil, unix.MNT_NOWAIT)
|
||||||
n, err := unix.Getfsstat(nil, flags)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
data := make([]unix.Statfs_t, n)
|
data := make([]unix.Statfs_t, n)
|
||||||
n2, err := unix.Getfsstat(data, flags)
|
n2, err := unix.Getfsstat(data, unix.MNT_NOWAIT)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -899,6 +899,32 @@ const (
|
|||||||
MAP_TRYFIXED = 0x400
|
MAP_TRYFIXED = 0x400
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_DEFEXPORTED = 0x200
|
||||||
|
MNT_DELEXPORT = 0x20000
|
||||||
|
MNT_DOOMED = 0x8000000
|
||||||
|
MNT_EXPORTANON = 0x400
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_EXRDONLY = 0x80
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_LAZY = 0x3
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_NOATIME = 0x8000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SOFTDEP = 0x4000000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x400ffff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
|
MNT_WANTRDWR = 0x2000000
|
||||||
|
MNT_WXALLOWED = 0x800
|
||||||
MSG_BCAST = 0x100
|
MSG_BCAST = 0x100
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
|
|||||||
@@ -939,6 +939,32 @@ const (
|
|||||||
MAP_TRYFIXED = 0x0
|
MAP_TRYFIXED = 0x0
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_DEFEXPORTED = 0x200
|
||||||
|
MNT_DELEXPORT = 0x20000
|
||||||
|
MNT_DOOMED = 0x8000000
|
||||||
|
MNT_EXPORTANON = 0x400
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_EXRDONLY = 0x80
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_LAZY = 0x3
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_NOATIME = 0x8000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SOFTDEP = 0x4000000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x400ffff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
|
MNT_WANTRDWR = 0x2000000
|
||||||
|
MNT_WXALLOWED = 0x800
|
||||||
MSG_BCAST = 0x100
|
MSG_BCAST = 0x100
|
||||||
MSG_CMSG_CLOEXEC = 0x800
|
MSG_CMSG_CLOEXEC = 0x800
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
|
|||||||
@@ -899,6 +899,32 @@ const (
|
|||||||
MAP_TRYFIXED = 0x0
|
MAP_TRYFIXED = 0x0
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_DEFEXPORTED = 0x200
|
||||||
|
MNT_DELEXPORT = 0x20000
|
||||||
|
MNT_DOOMED = 0x8000000
|
||||||
|
MNT_EXPORTANON = 0x400
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_EXRDONLY = 0x80
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_LAZY = 0x3
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_NOATIME = 0x8000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SOFTDEP = 0x4000000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x400ffff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
|
MNT_WANTRDWR = 0x2000000
|
||||||
|
MNT_WXALLOWED = 0x800
|
||||||
MSG_BCAST = 0x100
|
MSG_BCAST = 0x100
|
||||||
MSG_CMSG_CLOEXEC = 0x800
|
MSG_CMSG_CLOEXEC = 0x800
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
|
|||||||
Reference in New Issue
Block a user