The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
resource.h File Reference

process priorities: the nice value, -20 (the most CPU) to 19 (the least). More...

#include <sys/types.h>

Go to the source code of this file.

Macros

#define PRIO_PROCESS   0
#define PRIO_PGRP   1
#define PRIO_USER   2

Functions

int getpriority (int which, id_t who)
 the lowest nice value of the processes which and who name.
int setpriority (int which, id_t who, int value)
 set the nice value of processes.

Detailed Description

process priorities: the nice value, -20 (the most CPU) to 19 (the least).

ginnOS gives a process with a lower nice value a longer time slice.

Macro Definition Documentation

◆ PRIO_PROCESS

#define PRIO_PROCESS   0

◆ PRIO_PGRP

#define PRIO_PGRP   1

◆ PRIO_USER

#define PRIO_USER   2

Function Documentation

◆ getpriority()

int getpriority ( int which,
id_t who )

the lowest nice value of the processes which and who name.

Returns
the value, or -1 with errno set (-1 is also a nice value: set errno to 0 first to tell them apart).

◆ setpriority()

int setpriority ( int which,
id_t who,
int value )

set the nice value of processes.

only root may lower it.

Returns
0, or -1 (errno: ESRCH, EPERM, EACCES).