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