func setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = unix.BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = unix.BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := unix.Syscall6(unix.SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p1)) if e1 != 0 { err = syscall.Errno(e1) } return }
func getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = unix.BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = unix.BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := unix.Syscall6(unix.SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = syscall.Errno(e1) } return }
func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { oldPtr, err := unix.BytePtrFromString(oldpath) if err != nil { return } newPtr, err := unix.BytePtrFromString(newpath) if err != nil { return } _, _, errno := unix.Syscall6( SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(oldPtr)), uintptr(newdirfd), uintptr(unsafe.Pointer(newPtr)), uintptr(flags), 0, ) use(unsafe.Pointer(oldPtr)) use(unsafe.Pointer(newPtr)) if errno != 0 { // In the syscall module the authors box a couple of common errors // (i.e EAGAIN, EINVAL, and ENOENT). Is that worth doing here? err = errno } return }
func removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = unix.BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = unix.BytePtrFromString(attr) if err != nil { return } _, _, e1 := unix.Syscall(unix.SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p1)) if e1 != 0 { err = syscall.Errno(e1) } return }
func listxattr(path string, dest []byte, flags int) (sz int, err error) { var _p0 *byte _p0, err = unix.BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := unix.Syscall6(unix.SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0, 0) use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = syscall.Errno(e1) } return }