getpriority(2) System Calls Manual getpriority(2) getpriority, setpriority - / (libc -lc) #include int getpriority(int which, id_t who); int setpriority(int which, id_t who, int prio); which who getpriority() setpriority(). ( "nice") nice(2). which PRIO_PROCESS PRIO_PGRP PRIO_USER who which ( PRIO_PROCESS PRIO_PGRP PRIO_USER). who ( ) . prio -20 19 ( ) -20 19 . . 0 . getpriority() ( ) . setpriority() . nice ( ). 2.6.12 nice RLIMIT_NICE getrlimit(2) . getpriority() nice . -1 errno . getpriority() -1 errno errno -1 . setpriority() 0 . -1 errno . EACCES nice ( ) ( : CAP_SYS_NICE). EINVAL which PRIO_PROCESS PRIO_PGRP PRIO_USER. EPERM ( : CAP_SYS_NICE). . ESRCH which who . POSIX.1-2024. 4.2BSD, SVr4, SUSv1, POSIX.1-2001 XSI. EPERM . POSIX.1-2001 System V. 2.6.12 who ( ). 2.6.12 who. BSD (SunOS 4.1.3, Ultrix 4.2, 4.3BSD, FreeBSD 4.3, OpenBSD-2.5, ...) 2.6.12 . (nice value) sched(7). : " " 2.6.38 (nice) . sched(7). fork(2) nice . nice execve(2). C getpriority nice 40..1 . glibc getpriority() unice =20-ice ( 40..1 -20..19 ). POSIX nice . /NPTL POSIX nice : nice . . nice(1), renice(1), fork(2), capabilities(7), sched(7) Documentation/scheduler/sched-nice-design.rst ( 2.6.23) 3 . . : . 6.18 23 2026 getpriority(2)