Commit 9950ad11 authored by Tobias Klauser's avatar Tobias Klauser Committed by Brad Fitzpatrick

unix: add statfs and filesystem magic constants on Linux

Fixes golang/go#25341

Change-Id: I79cb4c77b771e005eb27d4e495ac6a7491e2e66e
Reviewed-on: https://go-review.googlesource.com/112696
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 7dfd1290
......@@ -38,6 +38,7 @@ package unix
#include <sys/select.h>
#include <sys/signal.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <sys/sysinfo.h>
#include <sys/time.h>
#include <sys/times.h>
......@@ -337,8 +338,6 @@ type _Gid_t C.gid_t
type Stat_t C.struct_stat
type Statfs_t C.struct_statfs
type StatxTimestamp C.struct_statx_timestamp
type Statx_t C.struct_statx
......@@ -972,3 +971,19 @@ type HDDriveCmdHdr C.struct_hd_drive_cmd_hdr
type HDGeometry C.struct_hd_geometry
type HDDriveID C.struct_hd_driveid
// Statfs
type Statfs_t C.struct_statfs
const (
ST_MANDLOCK = C.ST_MANDLOCK
ST_NOATIME = C.ST_NOATIME
ST_NODEV = C.ST_NODEV
ST_NODIRATIME = C.ST_NODIRATIME
ST_NOEXEC = C.ST_NOEXEC
ST_NOSUID = C.ST_NOSUID
ST_RDONLY = C.ST_RDONLY
ST_RELATIME = C.ST_RELATIME
ST_SYNCHRONOUS = C.ST_SYNCHRONOUS
)
......@@ -171,6 +171,7 @@ struct ltchars {
#include <linux/filter.h>
#include <linux/fs.h>
#include <linux/keyctl.h>
#include <linux/magic.h>
#include <linux/netlink.h>
#include <linux/perf_event.h>
#include <linux/random.h>
......@@ -426,6 +427,7 @@ ccflags="$@"
$2 ~ /^PERF_EVENT_IOC_/ ||
$2 ~ /^SECCOMP_MODE_/ ||
$2 ~ /^SPLICE_/ ||
$2 ~ /^[A-Z0-9_]+_MAGIC2?$/ ||
$2 ~ /^(VM|VMADDR)_/ ||
$2 ~ /^IOCTL_VM_SOCKETS_/ ||
$2 ~ /^(TASKSTATS|TS)_/ ||
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -116,21 +116,6 @@ type Stat_t struct {
Ino uint64
}
type Statfs_t struct {
Type int32
Bsize int32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int32
Frsize int32
Flags int32
Spare [4]int32
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1244,3 +1229,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int32
Bsize int32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int32
Frsize int32
Flags int32
Spare [4]int32
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -116,21 +116,6 @@ type Stat_t struct {
_ [3]int64
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1263,3 +1248,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -117,22 +117,6 @@ type Stat_t struct {
Ino uint64
}
type Statfs_t struct {
Type int32
Bsize int32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int32
Frsize int32
Flags int32
Spare [4]int32
_ [4]byte
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1233,3 +1217,31 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int32
Bsize int32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int32
Frsize int32
Flags int32
Spare [4]int32
_ [4]byte
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -117,21 +117,6 @@ type Stat_t struct {
_ [2]int32
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1242,3 +1227,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -115,23 +115,6 @@ type Stat_t struct {
Pad5 [14]int32
}
type Statfs_t struct {
Type int32
Bsize int32
Frsize int32
_ [4]byte
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int32
Flags int32
Spare [5]int32
_ [4]byte
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1238,3 +1221,32 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int32
Bsize int32
Frsize int32
_ [4]byte
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int32
Flags int32
Spare [5]int32
_ [4]byte
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -117,21 +117,6 @@ type Stat_t struct {
Blocks int64
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1244,3 +1229,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -117,21 +117,6 @@ type Stat_t struct {
Blocks int64
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1244,3 +1229,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -115,23 +115,6 @@ type Stat_t struct {
Pad5 [14]int32
}
type Statfs_t struct {
Type int32
Bsize int32
Frsize int32
_ [4]byte
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int32
Flags int32
Spare [5]int32
_ [4]byte
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1238,3 +1221,32 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int32
Bsize int32
Frsize int32
_ [4]byte
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int32
Flags int32
Spare [5]int32
_ [4]byte
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -118,21 +118,6 @@ type Stat_t struct {
_ uint64
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1252,3 +1237,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -118,21 +118,6 @@ type Stat_t struct {
_ uint64
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1252,3 +1237,30 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
......@@ -116,22 +116,6 @@ type Stat_t struct {
_ [3]int64
}
type Statfs_t struct {
Type uint32
Bsize uint32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen uint32
Frsize uint32
Flags uint32
Spare [4]uint32
_ [4]byte
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
......@@ -1269,3 +1253,31 @@ type HDDriveID struct {
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type uint32
Bsize uint32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen uint32
Frsize uint32
Flags uint32
Spare [4]uint32
_ [4]byte
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment