10#include <abi-bits/signal.h>
49#define PROCESS_MAGIC_PROC MOS_FOURCC('P', 'R', 'O', 'C')
50#define THREAD_MAGIC_THRD MOS_FOURCC('T', 'H', 'R', 'D')
85 if (
const auto ptr = process)
100 return stream <<
"[invalid]";
136 if (
auto ptr = thread;
ptr)
145 return stream <<
"[invalid]";
#define MOS_PROCESS_MAX_OPEN_FILES
basic_string_view< Char > value_or(basic_string_view< Char > other) const
list_node_t list_head
A linked list head.
#define THREAD_MAGIC_THRD
#define PROCESS_MAGIC_PROC
basic_string_view< char > string_view
T * create(Args &&...args)
mos::basic_string< char > string
as_linked_list
node in the parent's children list
static Process * New(Process *parent, mos::string_view name)
bool exited
true if the process has exited
platform_process_options_t platform_options
platform per-process flags
process_signal_info_t signal_info
signal handling info
dentry_t * working_directory
mos::list< Thread * > thread_list
static bool IsValid(const Process *process)
friend mos::SyslogStreamWriter operator<<(mos::SyslogStreamWriter stream, const Process *process)
Process(Private, Process *parent, mos::string_view name)
list_head children
list of children processes
fd_type files[MOS_PROCESS_MAX_OPEN_FILES]
u32 exit_status
exit status
platform_thread_options_t platform_options
platform-specific thread options
thread_mode mode
user-mode thread or kernel-mode
as_linked_list
node in the process's thread list
friend mos::SyslogStreamWriter operator<<(mos::SyslogStreamWriter stream, const Thread *thread)
static bool IsValid(const Thread *thread)
downwards_stack_t u_stack
user-mode stack
waitlist_t waiters
list of threads waiting for this thread to exit
downwards_stack_t k_stack
kernel-mode stack
spinlock_t state_lock
protects the thread state
thread_state_t state
thread state
thread_signal_info_t signal_info
sigaction_t handlers[SIGNAL_MAX_N]
signal handlers
waitlist_t sigchild_waitlist
the parent is waiting for a child to exit, if not empty
list_head pending
list of pending signals
sigset_t mask
pending signals mask
#define MOS_ENUM_FLAGS(enum, flags)