|
PatchworkOS
19e446b
A non-POSIX operating system.
|
#include <kernel/drivers/perf.h>#include <kernel/fs/cwd.h>#include <kernel/fs/devfs.h>#include <kernel/fs/file_table.h>#include <kernel/fs/namespace.h>#include <kernel/io/ring.h>#include <kernel/ipc/note.h>#include <kernel/mem/space.h>#include <kernel/proc/env.h>#include <kernel/proc/group.h>#include <kernel/sched/sched.h>#include <kernel/sched/thread.h>#include <kernel/sched/wait.h>#include <kernel/sync/futex.h>#include <kernel/sync/rcu.h>#include <kernel/utils/map.h>#include <kernel/utils/ref.h>#include <stdatomic.h>Go to the source code of this file.
Data Structures | |
| struct | process_threads_t |
| Represents the threads in a process. More... | |
| struct | process_status_t |
| Process exit status structure. More... | |
| struct | process_t |
| Process structure. More... | |
Macros | |
| #define | PROCESS_STATUS_MAX 256 |
| Maximum length of a process exit status. | |
| #define | PROCESS_RCU_THREAD_FOR_EACH(thread, process) LIST_FOR_EACH(thread, &(process)->threads.list, processEntry) |
| Macro to iterate over all threads in a process. | |
| #define | PROCESS_RCU_FOR_EACH(process) LIST_FOR_EACH(process, &_processes, entry) |
| Macro to iterate over all processes. | |
Enumerations | |
| enum | process_flags_t { PROCESS_NONE = 0 , PROCESS_DYING = 1 << 0 , PROCESS_SUSPENDED = 1 << 1 } |
| Process flags enum. More... | |
Functions | |
| process_t * | process_new (priority_t priority, group_member_t *group, namespace_t *ns) |
| Allocates and initializes a new process. | |
| static process_t * | process_current (void) |
| Retrieves the process of the currently running thread. | |
| static process_t * | process_current_unsafe (void) |
| Retrieves the process of the currently running thread without disabling interrupts. | |
| process_t * | process_get (pid_t id) |
| Gets a process by its ID. | |
| namespace_t * | process_get_ns (process_t *process) |
| Gets the namespace of a process. | |
| void | process_set_ns (process_t *process, namespace_t *ns) |
| Sets the namespace of a process. | |
| void | process_kill (process_t *process, const char *status) |
| Kills a process, pushing it to the reaper. | |
| void | process_remove (process_t *process) |
| Removes a process from the system. | |
| static thread_t * | process_rcu_first_thread (process_t *process) |
| Gets the first thread of a process. | |
| static uint64_t | process_rcu_thread_count (process_t *process) |
| Gets the amount of threads in a process. | |
| uint64_t | process_set_cmdline (process_t *process, char **argv, uint64_t argc) |
| Sets the command line arguments for a process. | |
| bool | process_has_thread (process_t *process, tid_t tid) |
| Checks if a process has a thread with the specified thread ID. | |
| process_t * | process_get_kernel (void) |
| Gets the kernel process. | |
Variables | |
| list_t | _processes |
| Global list of all processes. | |