CBuild wiki
Abstractions for process control.
License: GPL-3.0-or-later.
typedef struct cbuild_proclist_t {
cbuild_proc_t* data;
size_t size;
size_t capacity;
} cbuild_proclist_t;Dynamic array of processes.
Append new element to list of processes.
cbuild_proclist_t*
proclist Dynamic array object.cbuild_proc_t proc Process handle.Clears list of processes.
cbuild_proclist_t*
proclist Dynamic array object.Set element in process list using its index.
cbuild_proclist_t*
proclist List of processes.size_t idx Element index.cbuild_proc_t proc New element’s value.bool False on
overflow.
Get element from process list using its index.
cbuild_proclist_t*
proclist List of processes.size_t idx Slement index.cbuild_proc_t* Pointer
to an element or NULL on overflow.
Blocking wait until specific process finishes.
bool false if process
returned with an error.
Blocking wait until all processes from list exits.
bool false if at least
one process returned with an error.
Blocking wait until specific process finishes.
int Process exit code
or INT_MIN if proccbuild_proc_t is invalid
or INT_MAX on ECHILD or negative
signal value if process exited due to a signal.
Blocking wait until any process from list exits.
cbuild_proclist_t procs List of processess.int*
code Return value for exit code of
exited process, Could be NULL.ssize_t Index of exited
process in procscbuild_proclist_t
array.
Check if specific process is still running.
Function that can be used a child process entry point.
void*
args Arguments passed from parent
process.
int Exit code of a
process.
Start a new process.
cbuild_proc_func_t func Function that will be used as process’
entry point. Function should return exit code.void*
args Arguments that will be passed to
that functioncbuild_proc_t Process
handle of new process.
Pointer wrapper for shared memory.
void*
ptr Pointer to a memory.size_t size Length of memory region in
bytes.Allocate memory that will be shared between child processes. Same as
malloc.
Free memory that was allocated via cbuild_proc_malloc.
Same asfree.
Get amount of CPU cores (or threads).