PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
process.h File Reference
Include dependency graph for process.h:
This graph shows which files directly or indirectly include this file:

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_tprocess_new (priority_t priority, group_member_t *group, namespace_t *ns)
 Allocates and initializes a new process.
 
static process_tprocess_current (void)
 Retrieves the process of the currently running thread.
 
static process_tprocess_current_unsafe (void)
 Retrieves the process of the currently running thread without disabling interrupts.
 
process_tprocess_get (pid_t id)
 Gets a process by its ID.
 
namespace_tprocess_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_tprocess_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_tprocess_get_kernel (void)
 Gets the kernel process.
 

Variables

list_t _processes
 Global list of all processes.