diff options
author | 2023-09-11 09:50:37 +0000 | |
---|---|---|
committer | 2023-09-11 09:50:37 +0000 | |
commit | f0a3fcae856db66b71850e1aa35269f689b8931c (patch) | |
tree | b208105e7902b2e85dd9af4397e77c288610433f /vendor/golang.org/x/sys/unix/syscall_linux.go | |
parent | [docs] add fail2ban regex in the doc (#2189) (diff) | |
download | gotosocial-f0a3fcae856db66b71850e1aa35269f689b8931c.tar.xz |
[chore]: Bump golang.org/x/crypto from 0.12.0 to 0.13.0 (#2190)
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_linux.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_linux.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index a730878e4..0ba030197 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2471,6 +2471,29 @@ func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask * return pselect6(nfd, r, w, e, mutableTimeout, kernelMask) } +//sys schedSetattr(pid int, attr *SchedAttr, flags uint) (err error) +//sys schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error) + +// SchedSetAttr is a wrapper for sched_setattr(2) syscall. +// https://man7.org/linux/man-pages/man2/sched_setattr.2.html +func SchedSetAttr(pid int, attr *SchedAttr, flags uint) error { + if attr == nil { + return EINVAL + } + attr.Size = SizeofSchedAttr + return schedSetattr(pid, attr, flags) +} + +// SchedGetAttr is a wrapper for sched_getattr(2) syscall. +// https://man7.org/linux/man-pages/man2/sched_getattr.2.html +func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { + attr := &SchedAttr{} + if err := schedGetattr(pid, attr, SizeofSchedAttr, flags); err != nil { + return nil, err + } + return attr, nil +} + /* * Unimplemented */ |