Source file src/internal/syscall/unix/faccessat_darwin.go

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package unix
     6  
     7  import (
     8  	"internal/abi"
     9  	"syscall"
    10  	"unsafe"
    11  )
    12  
    13  func libc_faccessat_trampoline()
    14  
    15  //go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib"
    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  

View as plain text