Commit 1c958344 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

unix: add additional file mode bit constants from sys/stat.h on FreeBSD

Also generate the constants using mkerror.sh instead of having to list
each of them manually in types_freebsd.go

Change-Id: I00d38d0e528900be7c5afca05c8dc50ee7628b20
Reviewed-on: https://go-review.googlesource.com/129317
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 871208d9
...@@ -87,6 +87,7 @@ includes_FreeBSD=' ...@@ -87,6 +87,7 @@ includes_FreeBSD='
#include <sys/event.h> #include <sys/event.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#include <sys/stat.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/mount.h> #include <sys/mount.h>
......
...@@ -189,25 +189,6 @@ type _Gid_t C.gid_t ...@@ -189,25 +189,6 @@ type _Gid_t C.gid_t
// Files // Files
const ( // Directory mode bits
S_IFMT = C.S_IFMT
S_IFIFO = C.S_IFIFO
S_IFCHR = C.S_IFCHR
S_IFDIR = C.S_IFDIR
S_IFBLK = C.S_IFBLK
S_IFREG = C.S_IFREG
S_IFLNK = C.S_IFLNK
S_IFSOCK = C.S_IFSOCK
S_ISUID = C.S_ISUID
S_ISGID = C.S_ISGID
S_ISVTX = C.S_ISVTX
S_IRUSR = C.S_IRUSR
S_IWUSR = C.S_IWUSR
S_IXUSR = C.S_IXUSR
S_IRWXG = C.S_IRWXG
S_IRWXO = C.S_IRWXO
)
type Stat_t C.struct_stat8 type Stat_t C.struct_stat8
type Statfs_t C.struct_statfs type Statfs_t C.struct_statfs
......
...@@ -1345,6 +1345,35 @@ const ( ...@@ -1345,6 +1345,35 @@ const (
SO_USELOOPBACK = 0x40 SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015 SO_USER_COOKIE = 0x1015
SO_VENDOR = 0x80000000 SO_VENDOR = 0x80000000
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_IFWHT = 0xe000
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISTXT = 0x200
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0 TAB0 = 0x0
TAB3 = 0x4 TAB3 = 0x4
TABDLY = 0x4 TABDLY = 0x4
......
...@@ -1346,6 +1346,35 @@ const ( ...@@ -1346,6 +1346,35 @@ const (
SO_USELOOPBACK = 0x40 SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015 SO_USER_COOKIE = 0x1015
SO_VENDOR = 0x80000000 SO_VENDOR = 0x80000000
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_IFWHT = 0xe000
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISTXT = 0x200
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0 TAB0 = 0x0
TAB3 = 0x4 TAB3 = 0x4
TABDLY = 0x4 TABDLY = 0x4
......
...@@ -1354,6 +1354,35 @@ const ( ...@@ -1354,6 +1354,35 @@ const (
SO_USELOOPBACK = 0x40 SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015 SO_USER_COOKIE = 0x1015
SO_VENDOR = 0x80000000 SO_VENDOR = 0x80000000
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_IFWHT = 0xe000
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISTXT = 0x200
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0 TAB0 = 0x0
TAB3 = 0x4 TAB3 = 0x4
TABDLY = 0x4 TABDLY = 0x4
......
...@@ -56,25 +56,6 @@ type Rlimit struct { ...@@ -56,25 +56,6 @@ type Rlimit struct {
type _Gid_t uint32 type _Gid_t uint32
const (
S_IFMT = 0xf000
S_IFIFO = 0x1000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFBLK = 0x6000
S_IFREG = 0x8000
S_IFLNK = 0xa000
S_IFSOCK = 0xc000
S_ISUID = 0x800
S_ISGID = 0x400
S_ISVTX = 0x200
S_IRUSR = 0x100
S_IWUSR = 0x80
S_IXUSR = 0x40
S_IRWXG = 0x38
S_IRWXO = 0x7
)
type Stat_t struct { type Stat_t struct {
Dev uint32 Dev uint32
Ino uint32 Ino uint32
......
...@@ -56,25 +56,6 @@ type Rlimit struct { ...@@ -56,25 +56,6 @@ type Rlimit struct {
type _Gid_t uint32 type _Gid_t uint32
const (
S_IFMT = 0xf000
S_IFIFO = 0x1000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFBLK = 0x6000
S_IFREG = 0x8000
S_IFLNK = 0xa000
S_IFSOCK = 0xc000
S_ISUID = 0x800
S_ISGID = 0x400
S_ISVTX = 0x200
S_IRUSR = 0x100
S_IWUSR = 0x80
S_IXUSR = 0x40
S_IRWXG = 0x38
S_IRWXO = 0x7
)
type Stat_t struct { type Stat_t struct {
Dev uint32 Dev uint32
Ino uint32 Ino uint32
......
...@@ -58,25 +58,6 @@ type Rlimit struct { ...@@ -58,25 +58,6 @@ type Rlimit struct {
type _Gid_t uint32 type _Gid_t uint32
const (
S_IFMT = 0xf000
S_IFIFO = 0x1000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFBLK = 0x6000
S_IFREG = 0x8000
S_IFLNK = 0xa000
S_IFSOCK = 0xc000
S_ISUID = 0x800
S_ISGID = 0x400
S_ISVTX = 0x200
S_IRUSR = 0x100
S_IWUSR = 0x80
S_IXUSR = 0x40
S_IRWXG = 0x38
S_IRWXO = 0x7
)
type Stat_t struct { type Stat_t struct {
Dev uint32 Dev uint32
Ino uint32 Ino uint32
......
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