mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-27 02:04:28 +01:00
Fixes: #5983 sched-core only makes sense on Linux hosts. Let's add stub/error for other platforms. Signed-off-by: Eric Ernst <eric_ernst@apple.com> Signed-off-by: Danny Canter <danny@dcantah.dev>
21 lines
494 B
Go
21 lines
494 B
Go
// Copyright (c) 2023 Apple Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package utils
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// Create a new sched core domain
|
|
func Create(t PidType) error {
|
|
return unix.Prctl(unix.PR_SCHED_CORE, unix.PR_SCHED_CORE_CREATE, 0, uintptr(t), 0)
|
|
}
|
|
|
|
// ShareFrom shares the sched core domain from the provided pid
|
|
func ShareFrom(pid uint64, t PidType) error {
|
|
return unix.Prctl(unix.PR_SCHED_CORE, unix.PR_SCHED_CORE_SHARE_FROM, uintptr(pid), uintptr(t), 0)
|
|
}
|