// Copyright (C) 2018 The Syncthing Authors. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. //go:build !android // +build !android package osutil import ( "os" "syscall" "github.com/pkg/errors" ) const ioprioClassShift = 13 type ioprioClass int const ( ioprioClassRT ioprioClass = iota + 1 ioprioClassBE ioprioClassIdle ) const ( ioprioWhoProcess = iota + 1 ioprioWhoPGRP ioprioWhoUser ) func ioprioSet(class ioprioClass, value int) error { res, _, err := syscall.Syscall(syscall.SYS_IOPRIO_SET, uintptr(ioprioWhoProcess), 0, uintptr(class)<