PatchworkOS  dbbdc99
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
11 * other processes may still wish to access information about the process, such as its exit status.
12 *
13 * The reaper runs periodically and frees any "zombie" processes when they have no remaining threads by deinitializing
14 * its `/proc` directory, when none of the proc files or directories of the process are open its resources are finally
15 * freed.
16 *
17 * @{
18 */
19
20/**
21 * @brief Initializes the process reaper.
22 */
23void reaper_init(void);
24
25/**
26 * @brief Pushes a process to be reaped later.
27 *
28 * @param process The process to be reaped.
29 */
30void reaper_push(process_t* process);
31
32/** @} */
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:76