build 1.8.x, 1.9.x and 1.10 (#18)
Kuba Podgórski authored 6 years ago
GitHub committed 6 years ago
1 | 1 |
sudo: false
|
2 | 2 |
|
3 | 3 |
go:
|
4 | |
- 1.8
|
5 | |
- tip
|
|
4 |
- "1.8.x"
|
|
5 |
- "1.9.x"
|
|
6 |
- "1.10"
|
6 | 7 |
|
7 | 8 |
os:
|
8 | 9 |
- linux
|
7 | 7 |
)
|
8 | 8 |
|
9 | 9 |
func getxattr(path string, name string, value *byte, size int, pos int, options int) (int, error) {
|
10 | |
|
11 | 10 |
r0, _, e1 := syscall.Syscall6(syscall.SYS_GETXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))), uintptr(unsafe.Pointer(syscall.StringBytePtr(name))), uintptr(unsafe.Pointer(value)), uintptr(size), uintptr(pos), uintptr(options))
|
12 | 11 |
if e1 != syscall.Errno(0) {
|
13 | 12 |
return int(r0), e1
|
31 | 31 |
return nil, &Error{"xattr.List", path, "", err}
|
32 | 32 |
}
|
33 | 33 |
if size > 0 {
|
34 | |
|
35 | 34 |
buf := make([]byte, size)
|
36 | 35 |
// Read into buffer of that size.
|
37 | 36 |
read, err := listxattr(path, &buf[0], size, 0)
|
|
45 | 44 |
|
46 | 45 |
// Set associates name and data together as an attribute of path.
|
47 | 46 |
func Set(path, name string, data []byte) error {
|
48 | |
var dataval *byte = nil
|
|
47 |
var dataval *byte
|
49 | 48 |
datalen := len(data)
|
50 | 49 |
if datalen > 0 {
|
51 | 50 |
dataval = &data[0]
|
50 | 50 |
|
51 | 51 |
// Set associates name and data together as an attribute of path.
|
52 | 52 |
func Set(path, name string, data []byte) error {
|
53 | |
var dataval *byte = nil
|
|
53 |
var dataval *byte
|
54 | 54 |
datalen := len(data)
|
55 | 55 |
if datalen > 0 {
|
56 | 56 |
dataval = &data[0]
|
31 | 31 |
return nil, &Error{"xattr.List", path, "", err}
|
32 | 32 |
}
|
33 | 33 |
if size > 0 {
|
|
34 |
// `size + 1` because of ERANGE error when reading
|
|
35 |
// from a SMB1 mount point (https://github.com/pkg/xattr/issues/16).
|
34 | 36 |
buf := make([]byte, size+1)
|
35 | 37 |
// Read into buffer of that size.
|
36 | 38 |
read, err := syscall.Listxattr(path, buf)
|