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 | |
| 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')
| -rw-r--r-- | vendor/golang.org/x/sys/unix/mkerrors.sh | 1 | ||||
| -rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_linux.go | 23 | ||||
| -rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_unix.go | 3 | ||||
| -rw-r--r-- | vendor/golang.org/x/sys/unix/zerrors_linux.go | 17 | ||||
| -rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_linux.go | 20 | ||||
| -rw-r--r-- | vendor/golang.org/x/sys/unix/ztypes_linux.go | 15 | 
6 files changed, 79 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 8f775fafa..47fa6a7eb 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -583,6 +583,7 @@ ccflags="$@"  		$2 ~ /^PERF_/ ||  		$2 ~ /^SECCOMP_MODE_/ ||  		$2 ~ /^SEEK_/ || +		$2 ~ /^SCHED_/ ||  		$2 ~ /^SPLICE_/ ||  		$2 ~ /^SYNC_FILE_RANGE_/ ||  		$2 !~ /IOC_MAGIC/ && 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   */ diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 8bb30e7ce..f6eda2705 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -549,6 +549,9 @@ func SetNonblock(fd int, nonblocking bool) (err error) {  	if err != nil {  		return err  	} +	if (flag&O_NONBLOCK != 0) == nonblocking { +		return nil +	}  	if nonblocking {  		flag |= O_NONBLOCK  	} else { diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 3784f402e..0787a043b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2821,6 +2821,23 @@ const (  	RWF_SUPPORTED                               = 0x1f  	RWF_SYNC                                    = 0x4  	RWF_WRITE_LIFE_NOT_SET                      = 0x0 +	SCHED_BATCH                                 = 0x3 +	SCHED_DEADLINE                              = 0x6 +	SCHED_FIFO                                  = 0x1 +	SCHED_FLAG_ALL                              = 0x7f +	SCHED_FLAG_DL_OVERRUN                       = 0x4 +	SCHED_FLAG_KEEP_ALL                         = 0x18 +	SCHED_FLAG_KEEP_PARAMS                      = 0x10 +	SCHED_FLAG_KEEP_POLICY                      = 0x8 +	SCHED_FLAG_RECLAIM                          = 0x2 +	SCHED_FLAG_RESET_ON_FORK                    = 0x1 +	SCHED_FLAG_UTIL_CLAMP                       = 0x60 +	SCHED_FLAG_UTIL_CLAMP_MAX                   = 0x40 +	SCHED_FLAG_UTIL_CLAMP_MIN                   = 0x20 +	SCHED_IDLE                                  = 0x5 +	SCHED_NORMAL                                = 0x0 +	SCHED_RESET_ON_FORK                         = 0x40000000 +	SCHED_RR                                    = 0x2  	SCM_CREDENTIALS                             = 0x2  	SCM_RIGHTS                                  = 0x1  	SCM_TIMESTAMP                               = 0x1d diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index a07321bed..14ab34a56 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2197,3 +2197,23 @@ func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {  	RawSyscallNoError(SYS_GETRESGID, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))  	return  } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func schedSetattr(pid int, attr *SchedAttr, flags uint) (err error) { +	_, _, e1 := Syscall(SYS_SCHED_SETATTR, uintptr(pid), uintptr(unsafe.Pointer(attr)), uintptr(flags)) +	if e1 != 0 { +		err = errnoErr(e1) +	} +	return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error) { +	_, _, e1 := Syscall6(SYS_SCHED_GETATTR, uintptr(pid), uintptr(unsafe.Pointer(attr)), uintptr(size), uintptr(flags), 0, 0) +	if e1 != 0 { +		err = errnoErr(e1) +	} +	return +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 26ef52aaf..494493c78 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -5868,3 +5868,18 @@ const (  	VIRTIO_NET_HDR_GSO_UDP_L4 = 0x5  	VIRTIO_NET_HDR_GSO_ECN    = 0x80  ) + +type SchedAttr struct { +	Size     uint32 +	Policy   uint32 +	Flags    uint64 +	Nice     int32 +	Priority uint32 +	Runtime  uint64 +	Deadline uint64 +	Period   uint64 +	Util_min uint32 +	Util_max uint32 +} + +const SizeofSchedAttr = 0x38  | 
