From 871208d995a1ea8d7f548cb415e374b8054ee100 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 15 Aug 2018 07:26:56 +0000 Subject: [PATCH] unix: add additional file mode bit constants from sys/stat.h on DragonflyBSD Also generate the constants using mkerror.sh instead of having to list each of them manually in types_dragonfly.go Change-Id: I89b933834be6aa0eeec3d5ddbbf610e693b29327 Reviewed-on: https://go-review.googlesource.com/129316 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- unix/mkerrors.sh | 1 + unix/types_dragonfly.go | 17 ----------------- unix/zerrors_dragonfly_amd64.go | 32 +++++++++++++++++++++++++++++++- unix/ztypes_dragonfly_amd64.go | 17 ----------------- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh index 30939da0..4e8de00e 100755 --- a/unix/mkerrors.sh +++ b/unix/mkerrors.sh @@ -65,6 +65,7 @@ includes_DragonFly=' #include #include #include +#include #include #include #include diff --git a/unix/types_dragonfly.go b/unix/types_dragonfly.go index 0c633048..386d5f89 100644 --- a/unix/types_dragonfly.go +++ b/unix/types_dragonfly.go @@ -100,23 +100,6 @@ type _Gid_t C.gid_t // 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 -) - type Stat_t C.struct_stat type Statfs_t C.struct_statfs diff --git a/unix/zerrors_dragonfly_amd64.go b/unix/zerrors_dragonfly_amd64.go index 46a082b6..1de69989 100644 --- a/unix/zerrors_dragonfly_amd64.go +++ b/unix/zerrors_dragonfly_amd64.go @@ -3,7 +3,7 @@ // +build amd64,dragonfly -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix @@ -1168,6 +1168,36 @@ const ( SO_TIMESTAMP = 0x400 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDB = 0x9000 + 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 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 diff --git a/unix/ztypes_dragonfly_amd64.go b/unix/ztypes_dragonfly_amd64.go index 315a553b..c01ae670 100644 --- a/unix/ztypes_dragonfly_amd64.go +++ b/unix/ztypes_dragonfly_amd64.go @@ -56,23 +56,6 @@ type Rlimit struct { 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 -) - type Stat_t struct { Ino uint64 Nlink uint32