PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
reaper.h
Go to the documentation of this file.
1#pragma once
2
3typedef struct process process_t;
4
5/**
6 * @brief Process reaper for delayed process freeing.
7 * @defgroup kernel_proc_reaper Process reaper
8 * @ingroup kernel_proc
9 *
10 * The process reaper ensures that a process is not freed immediately after it is killed. This is important because other processes may still wish to access information about the process, such as its exit status.
11 *
12 * The reaper runs periodically and frees any "zombie" processes when they have no remaining threads by deinitializing its `/proc` directory, when none of the proc files or directories of the process are open its resources are finally freed.
13 *
14 * @{
15 */
16
17/**
18 * @brief Initializes the process reaper.
19 */
20void reaper_init(void);
21
22/**
23 * @brief Pushes a process to be reaped later.
24 *
25 * @param process The process to be reaped.
26 */
27void reaper_push(process_t* process);
28
29/** @} */
void reaper_push(process_t *process)
Pushes a process to be reaped later.
Definition reaper.c:66
void reaper_init(void)
Initializes the process reaper.
Definition reaper.c:58
Process structure.
Definition process.h:205