File: xattr_darwin.go

package info (click to toggle)
golang-bazil-fuse 0.0~git20160811.0.371fbbd-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, buster-backports
  • size: 728 kB
  • sloc: sh: 26; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package syscallx

/* This is the source file for syscallx_darwin_*.go, to regenerate run

   ./generate

*/

// cannot use dest []byte here because OS X getxattr really wants a
// NULL to trigger size probing, size==0 is not enough
//
//sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)

func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
	var destp *byte
	if len(dest) > 0 {
		destp = &dest[0]
	}
	return getxattr(path, attr, destp, len(dest), 0, 0)
}

//sys listxattr(path string, dest []byte, options int) (sz int, err error)

func Listxattr(path string, dest []byte) (sz int, err error) {
	return listxattr(path, dest, 0)
}

//sys setxattr(path string, attr string, data []byte, position uint32, flags int) (err error)

func Setxattr(path string, attr string, data []byte, flags int) (err error) {
	return setxattr(path, attr, data, 0, flags)
}

//sys removexattr(path string, attr string, options int) (err error)

func Removexattr(path string, attr string) (err error) {
	return removexattr(path, attr, 0)
}