CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
unix_sys_process.h
1#pragma once
2
3// Unix-internal declarations shared between the common Unix process code and the per-OS
4// backends (linux_sys_process.c, freebsd_sys_process.c). The platform contract itself lives in
5// cx/sys/process_private.h, which tail-includes this file.
6
7#include "cx/sys/process.h"
8
9// True if a process with this id exists. Used where there is no handle to consult, which on
10// Unix is every process cx did not fork.
11bool _procUnixAlive(ProcessID pid);
12
13// True if this handle's pid still refers to the process it was opened for, rather than to
14// something that was given the number after the original exited. Always true for a process cx
15// forked, and for one whose start time could not be read when the handle was opened.
16bool _procUnixSameProcess(Process* proc);
17
18// When the process with this id started, in whatever unit the OS reports. Only ever compared
19// against another reading for the same pid, to notice that the id has been handed to a
20// different process. False if it cannot be read. Implemented per OS.
21bool _procUnixStartTime(ProcessID pid, int64* out);
22
23// Publish a status collected by waitpid() or equivalent on the handle, decoding a death by
24// signal into the shell's 128 + signal convention.
25void _procUnixPublishStatus(Process* proc, int status);
int64 ProcessID
Operating system process id.
Definition process.h:128
Launching, inspecting and controlling operating system processes.