1// +build !linux,!darwin
2
3/*
4   Copyright The containerd Authors.
5
6   Licensed under the Apache License, Version 2.0 (the "License");
7   you may not use this file except in compliance with the License.
8   You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17*/
18
19package sysx
20
21import (
22	"errors"
23	"runtime"
24)
25
26var errUnsupported = errors.New("extended attributes unsupported on " + runtime.GOOS)
27
28// Listxattr calls syscall listxattr and reads all content
29// and returns a string array
30func Listxattr(path string) ([]string, error) {
31	return []string{}, nil
32}
33
34// Removexattr calls syscall removexattr
35func Removexattr(path string, attr string) (err error) {
36	return errUnsupported
37}
38
39// Setxattr calls syscall setxattr
40func Setxattr(path string, attr string, data []byte, flags int) (err error) {
41	return errUnsupported
42}
43
44// Getxattr calls syscall getxattr
45func Getxattr(path, attr string) ([]byte, error) {
46	return []byte{}, errUnsupported
47}
48
49// LListxattr lists xattrs, not following symlinks
50func LListxattr(path string) ([]string, error) {
51	return []string{}, nil
52}
53
54// LRemovexattr removes an xattr, not following symlinks
55func LRemovexattr(path string, attr string) (err error) {
56	return errUnsupported
57}
58
59// LSetxattr sets an xattr, not following symlinks
60func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
61	return errUnsupported
62}
63
64// LGetxattr gets an xattr, not following symlinks
65func LGetxattr(path, attr string) ([]byte, error) {
66	return []byte{}, nil
67}
68