mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
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:
parent
abc681ca5f
commit
7d64ae7a41
16
src/runtime/pkg/syscall/syscall_darwin.go
Normal file
16
src/runtime/pkg/syscall/syscall_darwin.go
Normal 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()
|
||||||
|
}
|
14
src/runtime/pkg/syscall/syscall_linux.go
Normal file
14
src/runtime/pkg/syscall/syscall_linux.go
Normal 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()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user