SchedSetaffinity wraps sched_setaffinity syscall without unix.CPUSet size limitation.
(pid int, buf []byte)
| 68 | |
| 69 | // SchedSetaffinity wraps sched_setaffinity syscall without unix.CPUSet size limitation. |
| 70 | func 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]. |
| 86 | func Sendmsg(fd int, p, oob []byte, to unix.Sockaddr, flags int) error { |
no test coverage detected
searching dependent graphs…