MCPcopy
hub / github.com/opencontainers/runc / SchedSetaffinity

Function SchedSetaffinity

internal/linux/linux.go:70–83  ·  view source on GitHub ↗

SchedSetaffinity wraps sched_setaffinity syscall without unix.CPUSet size limitation.

(pid int, buf []byte)

Source from the content-addressed store, hash-verified

68
69// SchedSetaffinity wraps sched_setaffinity syscall without unix.CPUSet size limitation.
70func SchedSetaffinity(pid int, buf []byte) error {
71 err := retryOnEINTR(func() error {
72 _, _, errno := unix.Syscall(
73 unix.SYS_SCHED_SETAFFINITY,
74 uintptr(pid),
75 uintptr(len(buf)),
76 uintptr((unsafe.Pointer)(&buf[0])))
77 if errno != 0 {
78 return errno
79 }
80 return nil
81 })
82 return os.NewSyscallError("sched_setaffinity", err)
83}
84
85// Sendmsg wraps [unix.Sendmsg].
86func Sendmsg(fd int, p, oob []byte, to unix.Sockaddr, flags int) error {

Callers 1

tryResetCPUAffinityFunction · 0.92

Calls 2

retryOnEINTRFunction · 0.85
SyscallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…