From 8d3b82dc77f1be1eb60021ae3909e654c0280c22 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 26 Jun 2017 18:18:20 +0200 Subject: [PATCH] unix: add Setxattr constants Add the XATTR_CREATE and XATTR_REPLACE constants, to be used in the flags parameter of Setxattr/Lsetxattr. See http://man7.org/linux/man-pages/man2/setxattr.2.html Fixes golang/go#14454 Change-Id: I868ac019fe3be755e0f6f8bff734f843ba602ee9 Reviewed-on: https://go-review.googlesource.com/46690 Reviewed-by: Brad Fitzpatrick --- unix/mkerrors.sh | 2 ++ unix/zerrors_linux_386.go | 2 ++ unix/zerrors_linux_amd64.go | 2 ++ unix/zerrors_linux_arm.go | 2 ++ unix/zerrors_linux_arm64.go | 2 ++ unix/zerrors_linux_mips.go | 2 ++ unix/zerrors_linux_mips64.go | 2 ++ unix/zerrors_linux_mips64le.go | 2 ++ unix/zerrors_linux_mipsle.go | 2 ++ unix/zerrors_linux_ppc64.go | 2 ++ unix/zerrors_linux_ppc64le.go | 2 ++ unix/zerrors_linux_s390x.go | 2 ++ 12 files changed, 24 insertions(+) diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh index d56eb43a..fc5fc8bb 100755 --- a/unix/mkerrors.sh +++ b/unix/mkerrors.sh @@ -153,6 +153,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -404,6 +405,7 @@ ccflags="$@" $2 ~ /^KEYCTL_/ || $2 ~ /^SPLICE_/ || $2 ~ /^(VM|VMADDR)_/ || + $2 ~ /^XATTR_(CREATE|REPLACE)/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} diff --git a/unix/zerrors_linux_386.go b/unix/zerrors_linux_386.go index e8d945ec..a21c3aba 100644 --- a/unix/zerrors_linux_386.go +++ b/unix/zerrors_linux_386.go @@ -1788,6 +1788,8 @@ const ( WORDSIZE = 0x20 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_amd64.go b/unix/zerrors_linux_amd64.go index 97dc0399..ed910fff 100644 --- a/unix/zerrors_linux_amd64.go +++ b/unix/zerrors_linux_amd64.go @@ -1789,6 +1789,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_arm.go b/unix/zerrors_linux_arm.go index 52f08f22..088f2f27 100644 --- a/unix/zerrors_linux_arm.go +++ b/unix/zerrors_linux_arm.go @@ -1793,6 +1793,8 @@ const ( WORDSIZE = 0x20 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_arm64.go b/unix/zerrors_linux_arm64.go index 0cfe25b2..0c8b652c 100644 --- a/unix/zerrors_linux_arm64.go +++ b/unix/zerrors_linux_arm64.go @@ -1778,6 +1778,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_mips.go b/unix/zerrors_linux_mips.go index 264a136a..2a115c06 100644 --- a/unix/zerrors_linux_mips.go +++ b/unix/zerrors_linux_mips.go @@ -1793,6 +1793,8 @@ const ( WORDSIZE = 0x20 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_mips64.go b/unix/zerrors_linux_mips64.go index bde3efbd..f9e6c4d7 100644 --- a/unix/zerrors_linux_mips64.go +++ b/unix/zerrors_linux_mips64.go @@ -1793,6 +1793,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_mips64le.go b/unix/zerrors_linux_mips64le.go index 167c2282..20005130 100644 --- a/unix/zerrors_linux_mips64le.go +++ b/unix/zerrors_linux_mips64le.go @@ -1793,6 +1793,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_mipsle.go b/unix/zerrors_linux_mipsle.go index 6c47abf7..b3978c59 100644 --- a/unix/zerrors_linux_mipsle.go +++ b/unix/zerrors_linux_mipsle.go @@ -1793,6 +1793,8 @@ const ( WORDSIZE = 0x20 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 ) diff --git a/unix/zerrors_linux_ppc64.go b/unix/zerrors_linux_ppc64.go index 32eccbd8..e2e5d84a 100644 --- a/unix/zerrors_linux_ppc64.go +++ b/unix/zerrors_linux_ppc64.go @@ -1850,6 +1850,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4000 XTABS = 0xc00 ) diff --git a/unix/zerrors_linux_ppc64le.go b/unix/zerrors_linux_ppc64le.go index eb944e67..9041bc10 100644 --- a/unix/zerrors_linux_ppc64le.go +++ b/unix/zerrors_linux_ppc64le.go @@ -1850,6 +1850,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4000 XTABS = 0xc00 ) diff --git a/unix/zerrors_linux_s390x.go b/unix/zerrors_linux_s390x.go index 35663490..d474634b 100644 --- a/unix/zerrors_linux_s390x.go +++ b/unix/zerrors_linux_s390x.go @@ -1850,6 +1850,8 @@ const ( WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 XCASE = 0x4 XTABS = 0x1800 )