The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
resource.h
Go to the documentation of this file.
1#pragma once
2
3#include <sys/types.h>
4
5/**
6 * @file sys/resource.h
7 * @brief process priorities: the nice value, -20 (the most CPU) to 19
8 * (the least). ginnOS gives a process with a lower nice value a
9 * longer time slice.
10 */
11
12#define PRIO_PROCESS 0 // who is a process id (0: the caller)
13#define PRIO_PGRP 1 // who is a process group (0: the caller's)
14#define PRIO_USER 2 // who is a user id (0: the caller's)
15
16/**
17 * the lowest nice value of the processes which and who name.
18 * @return the value, or -1 with errno set (-1 is also a nice value: set
19 * errno to 0 first to tell them apart).
20 */
21int getpriority(int which, id_t who);
22
23/**
24 * set the nice value of processes. only root may lower it.
25 * @return 0, or -1 (errno: ESRCH, EPERM, EACCES).
26 */
27int setpriority(int which, id_t who, int value);
int setpriority(int which, id_t who, int value)
set the nice value of processes.
int getpriority(int which, id_t who)
the lowest nice value of the processes which and who name.
basic system types.
unsigned int id_t
Definition types.h:28