Documentation ¶
Overview ¶
Package gionice is a port of the core parts of util-linux/ionice (GPL2 licensed)
Index ¶
- Constants
- func Idle() error
- func Naughty() error
- func Nice() error
- func NicePri(which, who int) (int, error)
- func Pri(which, who int) (uint, error)
- func Print(pid, who int)
- func Realtime() error
- func SetIDPri(which int, ioclass PriClass, data, who int) error
- func SetIdle(pgid int) error
- func SetIdlePID(pid int) error
- func SetNaughty(pgid int) error
- func SetNaughtyPID(pid int) error
- func SetNice(pgid int) error
- func SetNicePID(pid int) error
- func SetNicePri(which, who, ioprio int) error
- func SetPri(which, who int, ioprio uint) (uint, error)
- func SetRealTime(pgid int) error
- func SetRealTimePID(pid int) error
- type PriClass
Constants ¶
const ( IOPRIO_CLASS_NONE PriClass = 0 IOPRIO_CLASS_RT PriClass = 1 IOPRIO_CLASS_BE PriClass = 2 IOPRIO_CLASS_IDLE PriClass = 3 IOPRIO_WHO_PROCESS = 1 IOPRIO_WHO_PGRP = 2 IOPRIO_WHO_USER = 3 IOPRIO_CLASS_SHIFT = 13 )
const ( // From include/bits/resource.h PRIO_PROCESS = 0 PRIO_PGRP = 1 PRIO_USER = 2 )
Variables ¶
This section is empty.
Functions ¶
func Idle ¶ added in v1.3.0
func Idle() error
Idle will set the current process group IO niceness to "idle", level 7, if permitted.
func Naughty ¶ added in v1.3.0
func Naughty() error
Naughty will try to set the current process group niceness to level -20.
func Nice ¶ added in v1.3.0
func Nice() error
Nice will try to set the current process group niceness to level 10.
func NicePri ¶ added in v1.3.0
NicePri returns the IO priority for the given "which" (process, pgrp or user) and "who" (the ID).
func Pri ¶
Pri returns the IO priority for the given "which" (process, pgrp or user) and "who" (the ID).
func Realtime ¶ added in v1.3.0
func Realtime() error
Reltime will set the current process group IO niceness to "realtime", level 7, if permitted.
func SetIdle ¶
If permitted, set the given process group ID to "idle", level 7. Use 0 for the current process group.
func SetIdlePID ¶ added in v1.3.0
If permitted, set the given process ID to "idle", level 7. Use 0 for the current process.
func SetNaughty ¶ added in v1.3.0
If permitted, set the given process group nicess to level -20. Pass in PGID 0 for the current process group.
func SetNaughtyPID ¶ added in v1.3.0
If permitted, set the given process nicess to level -20. Pass in PID 0 for the current process.
func SetNice ¶ added in v1.3.0
If permitted, set the given process group niceness to level 10. Pass in PGID 0 for the current process group.
func SetNicePID ¶ added in v1.3.0
If permitted, set the given process niceness to level 10. Pass in PID 0 for the current process.
func SetNicePri ¶ added in v1.3.0
SetNicePri sets the IO priority for the given "which" (process, pgrp or user) and "who" (the ID), using the given io priority number.
func SetPri ¶
SetPri sets the IO priority for the given "which" (process, pgrp or user) and "who" (the ID), using the given io priority number.
func SetRealTime ¶
If permitted, set the given process group ID to "realtime", level 7. Use 0 for the current process group.
func SetRealTimePID ¶ added in v1.3.0
If permitted, set the given process ID to "realtime", level 7. Use 0 for the current process.