-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibc.go
More file actions
27 lines (22 loc) · 668 Bytes
/
libc.go
File metadata and controls
27 lines (22 loc) · 668 Bytes
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
// Copyright 2021 The Go Darwin Authors
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin
// +build darwin
package sys
import (
_ "syscall" // for go:linkname
"unsafe"
)
//go:noescape
//go:nosplit
//go:linkname libcCall runtime.libcCall
func libcCall(fn, arg unsafe.Pointer) int32
// LibcCall call fn with arg as its argument. Return what fn returns.
// fn is the raw pc value of the entry point of the desired function.
// Switches to the system stack, if not already there.
// Preserves the calling point as the location where a profiler traceback will begin.
//
//go:nosplit
func LibcCall(fn, arg unsafe.Pointer) int32 {
return libcCall(fn, arg)
}