|
AquilaOS documentation
How it works, and its code
|
A process. More...
#include <proc.h>
Data Fields | |
| pid_t | pid |
| the process's ID | |
| struct pgroup * | pgrp |
| its process group, and its node on the group's list | |
| struct qnode * | pgrp_node |
| char * | name |
| its name: the program it runs | |
| struct fd * | fds |
| its file descriptors (FDS_COUNT of them) | |
| struct proc * | parent |
| its parent | |
| struct vnode * | cwd |
| its current directory (a reference), or NULL for the root | |
| mode_t | mask |
| its file mode creation mask (umask) | |
| int | stopped |
| the signal that stopped it, or 0; and what waitpid() has to report (WAIT_*) | |
| int | wait_event |
| struct waitq | stop_queue |
| its stopped threads sleep here | |
| uint64_t | utime |
| its CPU time in user mode and in the kernel (ns), and that of the children it waited for | |
| uint64_t | stime |
| uint64_t | cutime |
| uint64_t | cstime |
| uint64_t | alarm_at |
| its real time timer (ITIMER_REAL): SIGALRM when arch_rtime_ns() reaches alarm_at, then every alarm_interval ns (0: only once); on the scheduler's alarms list while it's armed | |
| uint64_t | alarm_interval |
| struct list_node | alarm_link |
| uid_t | uid |
| its user and group IDs | |
| gid_t | gid |
| uintptr_t | heap_start |
| where its heap starts, and where it ends now (sbrk()) | |
| uintptr_t | heap |
| uintptr_t | entry |
| its program's entry point | |
| struct vm_space | vm_space |
| its address space | |
| struct vm_entry * | heap_vm |
| its heap's and its stack's mappings | |
| struct vm_entry * | stack_vm |
| struct queue | threads |
| its threads | |
| int | tid_last |
| the last thread ID given out (threads leave in any order, so their count can't be the next one's ID) | |
| struct waitq | thread_join |
| threads waiting in thread_join() sleep here | |
| sigset_t | sig_pending |
| its pending signals, a bit (1 << sig) each: a signal sent again while it's pending is delivered once (POSIX leaves this to us, and everyone does it) | |
| sigset_t | sigmask |
| its blocked signals, a bit (1 << sig) each | |
| struct waitq | wait_queue |
| a parent waiting for a child (waitpid()) sleeps here | |
| struct aquila_sigaction | sigaction [SIG_MAX+1] |
| its signal actions | |
| int | exit |
| its exit status (PROC_EXIT()) | |
| int | running |
| whether it's running | |
| int | zombie |
| proc_kill() is done with it, so it can be reaped (that isn't as soon as it stops running: closing its files may sleep) | |
| uint64_t proc::alarm_at |
its real time timer (ITIMER_REAL): SIGALRM when arch_rtime_ns() reaches alarm_at, then every alarm_interval ns (0: only once); on the scheduler's alarms list while it's armed
Definition at line 114 of file proc.h.
Referenced by sched_alarm(), sched_alarm_get(), and sched_timer_tick().
| uint64_t proc::alarm_interval |
Definition at line 114 of file proc.h.
Referenced by sched_alarm(), sched_alarm_get(), and sched_timer_tick().
| struct list_node proc::alarm_link |
Definition at line 115 of file proc.h.
Referenced by sched_alarm(), sched_alarm_get(), and sched_timer_tick().
| uint64_t proc::cstime |
Definition at line 109 of file proc.h.
Referenced by proc_reap().
| uint64_t proc::cutime |
Definition at line 109 of file proc.h.
Referenced by proc_reap().
| struct vnode* proc::cwd |
its current directory (a reference), or NULL for the root
Definition at line 93 of file proc.h.
Referenced by proc_fork(), proc_kill(), procfs_proc_status(), and sched_init_spawn().
| uintptr_t proc::entry |
its program's entry point
Definition at line 126 of file proc.h.
Referenced by arch_proc_init(), binfmt_elf_load_segments(), exec_stack_build(), exec_start(), and fork_proc_copy().
| int proc::exit |
its exit status (PROC_EXIT())
Definition at line 160 of file proc.h.
Referenced by proc_execve(), proc_kill(), sys_exit(), and sys_waitpid().
| struct fd* proc::fds |
its file descriptors (FDS_COUNT of them)
Definition at line 87 of file proc.h.
Referenced by copy_fds(), proc_execve(), proc_fd_close(), proc_fd_file(), proc_fd_get(), proc_fd_install(), proc_fd_release(), proc_fork(), proc_init(), and proc_kill().
| gid_t proc::gid |
Definition at line 119 of file proc.h.
Referenced by exec_stack_build(), fork_proc_copy(), and procfs_proc_status().
| uintptr_t proc::heap |
Definition at line 123 of file proc.h.
Referenced by binfmt_elf_load_segments(), binfmt_fmt_load(), fork_proc_copy(), and procfs_proc_status().
| uintptr_t proc::heap_start |
where its heap starts, and where it ends now (sbrk())
Definition at line 122 of file proc.h.
Referenced by binfmt_elf_load_segments(), binfmt_fmt_load(), and fork_proc_copy().
| struct vm_entry* proc::heap_vm |
its heap's and its stack's mappings
Definition at line 132 of file proc.h.
Referenced by binfmt_fmt_load(), proc_fork(), and procfs_proc_maps().
| mode_t proc::mask |
its file mode creation mask (umask)
Definition at line 96 of file proc.h.
Referenced by fork_proc_copy(), procfs_proc_status(), and sched_init_spawn().
| char* proc::name |
its name: the program it runs
Definition at line 84 of file proc.h.
Referenced by binfmt_fmt_load(), kproc_init(), proc_fork(), proc_reap(), procfs_finddir(), and procfs_proc_status().
| struct proc* proc::parent |
its parent
Definition at line 90 of file proc.h.
Referenced by pgrp_orphaned(), proc_fork(), proc_kill(), proc_reap(), proc_zombie_notify(), procfs_finddir(), procfs_proc_status(), signal_notify_parent(), sys_setpgid(), and sys_waitpid().
| struct pgroup* proc::pgrp |
its process group, and its node on the group's list
Definition at line 80 of file proc.h.
Referenced by fork_proc_copy(), pgrp_orphaned(), pgrp_orphaned_hangup(), pgrp_other_same_session(), proc_fork(), proc_kill(), proc_reap(), proc_setpgid(), session_new(), signal_send(), signal_take(), sys_setpgid(), sys_setsid(), sys_waitpid(), and tty_background().
| struct qnode* proc::pgrp_node |
Definition at line 81 of file proc.h.
Referenced by fork_proc_copy(), proc_fork(), proc_reap(), proc_setpgid(), session_new(), and sys_setsid().
| pid_t proc::pid |
the process's ID
Definition at line 77 of file proc.h.
Referenced by kproc_init(), proc_alive(), proc_fork(), proc_init(), proc_kill(), proc_pid_find(), proc_reap(), proc_setpgid(), procfs_finddir(), procfs_proc_maps(), procfs_proc_status(), procfs_proc_vmstats(), procfs_readdir(), session_new(), signal_send(), sys_fork(), sys_setpgid(), sys_setsid(), and sys_waitpid().
| int proc::running |
whether it's running
Definition at line 163 of file proc.h.
Referenced by kproc_init(), pgrp_orphaned_hangup(), proc_alive(), proc_kill(), proc_new(), signal_send(), signal_take(), and signal_to().
| sigset_t proc::sig_pending |
its pending signals, a bit (1 << sig) each: a signal sent again while it's pending is delivered once (POSIX leaves this to us, and everyone does it)
Definition at line 148 of file proc.h.
Referenced by proc_kill(), procfs_proc_status(), signal_action_set(), signal_interrupts(), signal_take(), and signal_to().
| struct aquila_sigaction proc::sigaction[SIG_MAX+1] |
its signal actions
Definition at line 157 of file proc.h.
Referenced by aarch64_return_to_user(), deliver(), deliver(), fork_proc_copy(), kproc_init(), proc_execve(), proc_new(), proc_zombie_notify(), signal_force(), signal_ignored(), signal_notify_parent(), signal_stops(), signal_take(), tty_background(), and x86_return_to_user().
| sigset_t proc::sigmask |
its blocked signals, a bit (1 << sig) each
Definition at line 151 of file proc.h.
Referenced by aarch64_return_to_user(), deliver(), deliver(), fork_proc_copy(), procfs_proc_status(), signal_force(), signal_interrupts(), signal_take(), signal_to(), tty_background(), and x86_return_to_user().
| struct vm_entry* proc::stack_vm |
Definition at line 133 of file proc.h.
Referenced by binfmt_fmt_load(), proc_fork(), and procfs_proc_maps().
| uint64_t proc::stime |
Definition at line 108 of file proc.h.
Referenced by proc_reap().
| struct waitq proc::stop_queue |
its stopped threads sleep here
Definition at line 104 of file proc.h.
Referenced by signal_stop(), and signal_to().
| int proc::stopped |
the signal that stopped it, or 0; and what waitpid() has to report (WAIT_*)
Definition at line 100 of file proc.h.
Referenced by pgrp_orphaned_hangup(), signal_stop(), signal_to(), and sys_waitpid().
| struct waitq proc::thread_join |
threads waiting in thread_join() sleep here
Definition at line 143 of file proc.h.
Referenced by proc_threads_exec(), sched_thread_killed(), and sys_thread_exit().
| struct queue proc::threads |
its threads
Definition at line 136 of file proc.h.
Referenced by arch_proc_fork(), arch_proc_init(), binfmt_fmt_load(), exec_start(), init_execve(), kmain(), kthread_create(), proc_fork(), proc_kill(), proc_new(), proc_threads_end(), procfs_proc_status(), sched_init_spawn(), sched_thread_killed(), signal_to(), sys_fork(), sys_thread_exit(), sys_thread_join(), thread_create(), and thread_new().
| int proc::tid_last |
the last thread ID given out (threads leave in any order, so their count can't be the next one's ID)
Definition at line 140 of file proc.h.
Referenced by thread_new().
| uid_t proc::uid |
its user and group IDs
Definition at line 118 of file proc.h.
Referenced by exec_stack_build(), fork_proc_copy(), and procfs_proc_status().
| uint64_t proc::utime |
its CPU time in user mode and in the kernel (ns), and that of the children it waited for
Definition at line 108 of file proc.h.
Referenced by proc_reap().
| struct vm_space proc::vm_space |
its address space
Definition at line 129 of file proc.h.
Referenced by arch_sigcode_map(), arch_thread_spawn(), arch_thread_switch(), binfmt_elf_load_segments(), binfmt_fmt_load(), init_execve(), kmain(), kproc_init(), proc_execve(), proc_fork(), proc_kill(), proc_new(), procfs_proc_maps(), and procfs_proc_vmstats().
| int proc::wait_event |
Definition at line 101 of file proc.h.
Referenced by signal_stop(), signal_to(), and sys_waitpid().
| struct waitq proc::wait_queue |
a parent waiting for a child (waitpid()) sleeps here
Definition at line 154 of file proc.h.
Referenced by proc_zombie_notify(), and signal_notify_parent().
| int proc::zombie |
proc_kill() is done with it, so it can be reaped (that isn't as soon as it stops running: closing its files may sleep)
Definition at line 167 of file proc.h.
Referenced by pgrp_orphaned(), proc_kill(), and sys_waitpid().