runtime: Add a syscall wrapper package

It allows to support syscall variations between host OSes.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
This commit is contained in:
Samuel Ortiz 2022-02-26 10:49:52 +01:00 committed by Eric Ernst
parent abc681ca5f
commit 7d64ae7a41
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Copyright (c) 2022 Apple Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
package syscall
import (
"syscall"
)
func Gettid() int {
// There is no equivalent to a thread ID on Darwin.
// We use the PID instead.
return syscall.Getpid()
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2022 Apple Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
package syscall
import (
"syscall"
)
func Gettid() int {
return syscall.Gettid()
}