diff --git a/Gopkg.lock b/Gopkg.lock index 966f9dd..af5a6ab 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -49,7 +49,7 @@ [[projects]] branch = "master" - digest = "1:8da06ec4e3ad93b1315e59fa31393e43ae1b7e6d2111f12383e21b74bd29493f" + digest = "1:945b127fc2488b7efd24553b270158847219fd9fa32d6fd2bece3bac81d02d7e" name = "golang.org/x/sys" packages = [ "unix", @@ -58,7 +58,7 @@ "windows/svc/mgr", ] pruneopts = "UT" - revision = "ac6580df4449443a05718fd7858c1f91ad5f8d20" + revision = "0732a990476f7f2f5f7200b39ba4ab730c0f09f8" [solve-meta] analyzer-name = "dep" diff --git a/disk/disk_freebsd.go b/disk/disk_freebsd.go index 2e0966a..c673969 100644 --- a/disk/disk_freebsd.go +++ b/disk/disk_freebsd.go @@ -23,64 +23,64 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro var ret []PartitionStat // get length - count, err := unix.Getfsstat(nil, MNT_WAIT) + count, err := unix.Getfsstat(nil, unix.MNT_WAIT) if err != nil { return ret, err } fs := make([]Statfs, count) - if _, err = Getfsstat(fs, MNT_WAIT); err != nil { + if _, err = Getfsstat(fs, unix.MNT_WAIT); err != nil { return ret, err } for _, stat := range fs { opts := "rw" - if stat.Flags&MNT_RDONLY != 0 { + if stat.Flags&unix.MNT_RDONLY != 0 { opts = "ro" } - if stat.Flags&MNT_SYNCHRONOUS != 0 { + if stat.Flags&unix.MNT_SYNCHRONOUS != 0 { opts += ",sync" } - if stat.Flags&MNT_NOEXEC != 0 { + if stat.Flags&unix.MNT_NOEXEC != 0 { opts += ",noexec" } - if stat.Flags&MNT_NOSUID != 0 { + if stat.Flags&unix.MNT_NOSUID != 0 { opts += ",nosuid" } - if stat.Flags&MNT_UNION != 0 { + if stat.Flags&unix.MNT_UNION != 0 { opts += ",union" } - if stat.Flags&MNT_ASYNC != 0 { + if stat.Flags&unix.MNT_ASYNC != 0 { opts += ",async" } - if stat.Flags&MNT_SUIDDIR != 0 { + if stat.Flags&unix.MNT_SUIDDIR != 0 { opts += ",suiddir" } - if stat.Flags&MNT_SOFTDEP != 0 { + if stat.Flags&unix.MNT_SOFTDEP != 0 { opts += ",softdep" } - if stat.Flags&MNT_NOSYMFOLLOW != 0 { + if stat.Flags&unix.MNT_NOSYMFOLLOW != 0 { opts += ",nosymfollow" } - if stat.Flags&MNT_GJOURNAL != 0 { + if stat.Flags&unix.MNT_GJOURNAL != 0 { opts += ",gjounalc" } - if stat.Flags&MNT_MULTILABEL != 0 { + if stat.Flags&unix.MNT_MULTILABEL != 0 { opts += ",multilabel" } - if stat.Flags&MNT_ACLS != 0 { + if stat.Flags&unix.MNT_ACLS != 0 { opts += ",acls" } - if stat.Flags&MNT_NOATIME != 0 { + if stat.Flags&unix.MNT_NOATIME != 0 { opts += ",noattime" } - if stat.Flags&MNT_NOCLUSTERR != 0 { + if stat.Flags&unix.MNT_NOCLUSTERR != 0 { opts += ",nocluster" } - if stat.Flags&MNT_NOCLUSTERW != 0 { + if stat.Flags&unix.MNT_NOCLUSTERW != 0 { opts += ",noclusterw" } - if stat.Flags&MNT_NFS4ACLS != 0 { + if stat.Flags&unix.MNT_NFS4ACLS != 0 { opts += ",nfs4acls" } diff --git a/disk/disk_freebsd_386.go b/disk/disk_freebsd_386.go index 0b3f536..5f39aa5 100644 --- a/disk/disk_freebsd_386.go +++ b/disk/disk_freebsd_386.go @@ -15,28 +15,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_UNION = 0x00000020 - MNT_ASYNC = 0x00000040 - MNT_SUIDDIR = 0x00100000 - MNT_SOFTDEP = 0x00200000 - MNT_NOSYMFOLLOW = 0x00400000 - MNT_GJOURNAL = 0x02000000 - MNT_MULTILABEL = 0x04000000 - MNT_ACLS = 0x08000000 - MNT_NOATIME = 0x10000000 - MNT_NOCLUSTERR = 0x40000000 - MNT_NOCLUSTERW = 0x80000000 - MNT_NFS4ACLS = 0x00000010 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 - MNT_SUSPEND = 4 ) const ( diff --git a/disk/disk_freebsd_amd64.go b/disk/disk_freebsd_amd64.go index 89b617c..752a35f 100644 --- a/disk/disk_freebsd_amd64.go +++ b/disk/disk_freebsd_amd64.go @@ -15,28 +15,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_UNION = 0x00000020 - MNT_ASYNC = 0x00000040 - MNT_SUIDDIR = 0x00100000 - MNT_SOFTDEP = 0x00200000 - MNT_NOSYMFOLLOW = 0x00400000 - MNT_GJOURNAL = 0x02000000 - MNT_MULTILABEL = 0x04000000 - MNT_ACLS = 0x08000000 - MNT_NOATIME = 0x10000000 - MNT_NOCLUSTERR = 0x40000000 - MNT_NOCLUSTERW = 0x80000000 - MNT_NFS4ACLS = 0x00000010 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 - MNT_SUSPEND = 4 ) const ( diff --git a/disk/disk_freebsd_arm.go b/disk/disk_freebsd_arm.go index 0b3f536..5f39aa5 100644 --- a/disk/disk_freebsd_arm.go +++ b/disk/disk_freebsd_arm.go @@ -15,28 +15,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_UNION = 0x00000020 - MNT_ASYNC = 0x00000040 - MNT_SUIDDIR = 0x00100000 - MNT_SOFTDEP = 0x00200000 - MNT_NOSYMFOLLOW = 0x00400000 - MNT_GJOURNAL = 0x02000000 - MNT_MULTILABEL = 0x04000000 - MNT_ACLS = 0x08000000 - MNT_NOATIME = 0x10000000 - MNT_NOCLUSTERR = 0x40000000 - MNT_NOCLUSTERW = 0x80000000 - MNT_NFS4ACLS = 0x00000010 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 - MNT_SUSPEND = 4 ) const ( diff --git a/disk/disk_freebsd_arm64.go b/disk/disk_freebsd_arm64.go index aff604c..d03f1f6 100644 --- a/disk/disk_freebsd_arm64.go +++ b/disk/disk_freebsd_arm64.go @@ -6,39 +6,17 @@ package disk const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 - sizeofLongDouble = 0x8 + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 + sizeofLongDouble = 0x8 - DEVSTAT_NO_DATA = 0x00 - DEVSTAT_READ = 0x01 - DEVSTAT_WRITE = 0x02 - DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_UNION = 0x00000020 - MNT_ASYNC = 0x00000040 - MNT_SUIDDIR = 0x00100000 - MNT_SOFTDEP = 0x00200000 - MNT_NOSYMFOLLOW = 0x00400000 - MNT_GJOURNAL = 0x02000000 - MNT_MULTILABEL = 0x04000000 - MNT_ACLS = 0x08000000 - MNT_NOATIME = 0x10000000 - MNT_NOCLUSTERR = 0x40000000 - MNT_NOCLUSTERW = 0x80000000 - MNT_NFS4ACLS = 0x00000010 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 - MNT_SUSPEND = 4 + DEVSTAT_NO_DATA = 0x00 + DEVSTAT_READ = 0x01 + DEVSTAT_WRITE = 0x02 + DEVSTAT_FREE = 0x03 ) const ( @@ -46,68 +24,68 @@ const ( ) type ( - _C_short int16 - _C_int int32 - _C_long int64 - _C_long_long int64 - _C_long_double int64 + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 + _C_long_double int64 ) type Statfs struct { - Version uint32 - Type uint32 - Flags uint64 - Bsize uint64 - Iosize uint64 - Blocks uint64 - Bfree uint64 - Bavail int64 - Files uint64 - Ffree int64 - Syncwrites uint64 - Asyncwrites uint64 - Syncreads uint64 - Asyncreads uint64 - Spare [10]uint64 - Namemax uint32 - Owner uint32 - Fsid Fsid - Charspare [80]uint8 - Fstypename [16]int8 - Mntfromname [1024]int8 - Mntonname [1024]int8 + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]uint8 + Fstypename [16]int8 + Mntfromname [1024]int8 + Mntonname [1024]int8 } type Fsid struct { Val [2]int32 } type Devstat struct { - Sequence0 uint32 - Allocated int32 - Start_count uint32 - End_count uint32 - Busy_from Bintime - Dev_links _Ctype_struct___0 - Device_number uint32 - Device_name [16]int8 - Unit_number int32 - Bytes [4]uint64 - Operations [4]uint64 - Duration [4]Bintime - Busy_time Bintime - Creation_time Bintime - Block_size uint32 - Tag_types [3]uint64 - Flags uint32 - Device_type uint32 - Priority uint32 - Id *byte - Sequence1 uint32 - Pad_cgo_0 [4]byte + Sequence0 uint32 + Allocated int32 + Start_count uint32 + End_count uint32 + Busy_from Bintime + Dev_links _Ctype_struct___0 + Device_number uint32 + Device_name [16]int8 + Unit_number int32 + Bytes [4]uint64 + Operations [4]uint64 + Duration [4]Bintime + Busy_time Bintime + Creation_time Bintime + Block_size uint32 + Tag_types [3]uint64 + Flags uint32 + Device_type uint32 + Priority uint32 + Id *byte + Sequence1 uint32 + Pad_cgo_0 [4]byte } type Bintime struct { - Sec int64 - Frac uint64 + Sec int64 + Frac uint64 } type _Ctype_struct___0 struct { diff --git a/disk/disk_openbsd.go b/disk/disk_openbsd.go index 6fdf386..e8d0d19 100644 --- a/disk/disk_openbsd.go +++ b/disk/disk_openbsd.go @@ -21,34 +21,34 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro var ret []PartitionStat // get length - count, err := unix.Getfsstat(nil, MNT_WAIT) + count, err := unix.Getfsstat(nil, unix.MNT_WAIT) if err != nil { return ret, err } fs := make([]Statfs, count) - if _, err = Getfsstat(fs, MNT_WAIT); err != nil { + if _, err = Getfsstat(fs, unix.MNT_WAIT); err != nil { return ret, err } for _, stat := range fs { opts := "rw" - if stat.F_flags&MNT_RDONLY != 0 { + if stat.F_flags&unix.MNT_RDONLY != 0 { opts = "ro" } - if stat.F_flags&MNT_SYNCHRONOUS != 0 { + if stat.F_flags&unix.MNT_SYNCHRONOUS != 0 { opts += ",sync" } - if stat.F_flags&MNT_NOEXEC != 0 { + if stat.F_flags&unix.MNT_NOEXEC != 0 { opts += ",noexec" } - if stat.F_flags&MNT_NOSUID != 0 { + if stat.F_flags&unix.MNT_NOSUID != 0 { opts += ",nosuid" } - if stat.F_flags&MNT_NODEV != 0 { + if stat.F_flags&unix.MNT_NODEV != 0 { opts += ",nodev" } - if stat.F_flags&MNT_ASYNC != 0 { + if stat.F_flags&unix.MNT_ASYNC != 0 { opts += ",async" } diff --git a/disk/disk_openbsd_386.go b/disk/disk_openbsd_386.go index bee3cc1..c01ff5a 100644 --- a/disk/disk_openbsd_386.go +++ b/disk/disk_openbsd_386.go @@ -15,17 +15,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_NODEV = 0x00000010 - MNT_ASYNC = 0x00000040 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 ) const ( diff --git a/disk/disk_openbsd_amd64.go b/disk/disk_openbsd_amd64.go index 07a845f..c9dcedc 100644 --- a/disk/disk_openbsd_amd64.go +++ b/disk/disk_openbsd_amd64.go @@ -15,17 +15,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - MNT_RDONLY = 0x00000001 - MNT_SYNCHRONOUS = 0x00000002 - MNT_NOEXEC = 0x00000004 - MNT_NOSUID = 0x00000008 - MNT_NODEV = 0x00000010 - MNT_ASYNC = 0x00000040 - - MNT_WAIT = 1 - MNT_NOWAIT = 2 - MNT_LAZY = 3 ) const ( diff --git a/disk/types_freebsd.go b/disk/types_freebsd.go index dd6ddc4..525e9af 100644 --- a/disk/types_freebsd.go +++ b/disk/types_freebsd.go @@ -42,29 +42,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - // from sys/mount.h - MNT_RDONLY = 0x00000001 /* read only filesystem */ - MNT_SYNCHRONOUS = 0x00000002 /* filesystem written synchronously */ - MNT_NOEXEC = 0x00000004 /* can't exec from filesystem */ - MNT_NOSUID = 0x00000008 /* don't honor setuid bits on fs */ - MNT_UNION = 0x00000020 /* union with underlying filesystem */ - MNT_ASYNC = 0x00000040 /* filesystem written asynchronously */ - MNT_SUIDDIR = 0x00100000 /* special handling of SUID on dirs */ - MNT_SOFTDEP = 0x00200000 /* soft updates being done */ - MNT_NOSYMFOLLOW = 0x00400000 /* do not follow symlinks */ - MNT_GJOURNAL = 0x02000000 /* GEOM journal support enabled */ - MNT_MULTILABEL = 0x04000000 /* MAC support for individual objects */ - MNT_ACLS = 0x08000000 /* ACL support enabled */ - MNT_NOATIME = 0x10000000 /* disable update of file access time */ - MNT_NOCLUSTERR = 0x40000000 /* disable cluster read */ - MNT_NOCLUSTERW = 0x80000000 /* disable cluster write */ - MNT_NFS4ACLS = 0x00000010 - - MNT_WAIT = 1 /* synchronously wait for I/O to complete */ - MNT_NOWAIT = 2 /* start all I/O, but do not wait for it */ - MNT_LAZY = 3 /* push data not written by filesystem syncer */ - MNT_SUSPEND = 4 /* Suspend file system after sync */ ) const ( diff --git a/disk/types_openbsd.go b/disk/types_openbsd.go index 1e3ddef..79122a4 100644 --- a/disk/types_openbsd.go +++ b/disk/types_openbsd.go @@ -33,18 +33,6 @@ const ( DEVSTAT_READ = 0x01 DEVSTAT_WRITE = 0x02 DEVSTAT_FREE = 0x03 - - // from sys/mount.h - MNT_RDONLY = 0x00000001 /* read only filesystem */ - MNT_SYNCHRONOUS = 0x00000002 /* filesystem written synchronously */ - MNT_NOEXEC = 0x00000004 /* can't exec from filesystem */ - MNT_NOSUID = 0x00000008 /* don't honor setuid bits on fs */ - MNT_NODEV = 0x00000010 /* don't interpret special files */ - MNT_ASYNC = 0x00000040 /* filesystem written asynchronously */ - - MNT_WAIT = 1 /* synchronously wait for I/O to complete */ - MNT_NOWAIT = 2 /* start all I/O, but do not wait for it */ - MNT_LAZY = 3 /* push data not written by filesystem syncer */ ) const (