Commit 8d3b82dc authored by Tobias Klauser's avatar Tobias Klauser Committed by Brad Fitzpatrick

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/46690Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent c23410a8
...@@ -153,6 +153,7 @@ struct ltchars { ...@@ -153,6 +153,7 @@ struct ltchars {
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/xattr.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_alg.h> #include <linux/if_alg.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
...@@ -404,6 +405,7 @@ ccflags="$@" ...@@ -404,6 +405,7 @@ ccflags="$@"
$2 ~ /^KEYCTL_/ || $2 ~ /^KEYCTL_/ ||
$2 ~ /^SPLICE_/ || $2 ~ /^SPLICE_/ ||
$2 ~ /^(VM|VMADDR)_/ || $2 ~ /^(VM|VMADDR)_/ ||
$2 ~ /^XATTR_(CREATE|REPLACE)/ ||
$2 !~ "WMESGLEN" && $2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ || $2 ~ /^W[A-Z0-9]+$/ ||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
......
...@@ -1788,6 +1788,8 @@ const ( ...@@ -1788,6 +1788,8 @@ const (
WORDSIZE = 0x20 WORDSIZE = 0x20
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1789,6 +1789,8 @@ const ( ...@@ -1789,6 +1789,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1793,6 +1793,8 @@ const ( ...@@ -1793,6 +1793,8 @@ const (
WORDSIZE = 0x20 WORDSIZE = 0x20
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1778,6 +1778,8 @@ const ( ...@@ -1778,6 +1778,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1793,6 +1793,8 @@ const ( ...@@ -1793,6 +1793,8 @@ const (
WORDSIZE = 0x20 WORDSIZE = 0x20
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1793,6 +1793,8 @@ const ( ...@@ -1793,6 +1793,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1793,6 +1793,8 @@ const ( ...@@ -1793,6 +1793,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1793,6 +1793,8 @@ const ( ...@@ -1793,6 +1793,8 @@ const (
WORDSIZE = 0x20 WORDSIZE = 0x20
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
...@@ -1850,6 +1850,8 @@ const ( ...@@ -1850,6 +1850,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4000 XCASE = 0x4000
XTABS = 0xc00 XTABS = 0xc00
) )
......
...@@ -1850,6 +1850,8 @@ const ( ...@@ -1850,6 +1850,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4000 XCASE = 0x4000
XTABS = 0xc00 XTABS = 0xc00
) )
......
...@@ -1850,6 +1850,8 @@ const ( ...@@ -1850,6 +1850,8 @@ const (
WORDSIZE = 0x40 WORDSIZE = 0x40
WSTOPPED = 0x2 WSTOPPED = 0x2
WUNTRACED = 0x2 WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4 XCASE = 0x4
XTABS = 0x1800 XTABS = 0x1800
) )
......
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