...
1
2
3
4
5 package unix
6
7 import (
8 "internal/abi"
9 "syscall"
10 "unsafe"
11 )
12
13 func libc_faccessat_trampoline()
14
15
16
17 func faccessat(dirfd int, path string, mode uint32, flags int) error {
18 p, err := syscall.BytePtrFromString(path)
19 if err != nil {
20 return err
21 }
22 _, _, errno := syscall_syscall6(abi.FuncPCABI0(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(p)), uintptr(mode), uintptr(flags), 0, 0)
23 if errno != 0 {
24 return errno
25 }
26 return nil
27 }
28
29 func Eaccess(path string, mode uint32) error {
30 return faccessat(AT_FDCWD, path, mode, AT_EACCESS)
31 }
32
View as plain text