Process v0.1.0
Exit
pub func Exit(code: int32)
Ends the calling thread's process with code.
code is read by value; only its low eight bits reach a waiting parent, which is the kernel's rule rather than
this binding's. Does not return.
Nothing is flushed, unwound, or destroyed on the way out: the kernel reclaims the address space and the
descriptors, and anything the program was holding elsewhere is simply gone.
This ends the whole process rather than one thread: it is exit_group, not exit, which on Linux stops only the
calling thread and would leave the others running.
Parameters
| Name | Type | Description |
|---|---|---|
code | int32 | the status to report to the parent |
GetPid
pub func GetPid() -> ProcessId
The calling process's own identifier. Takes nothing and returns the identifier by copy. Cannot fail: every process has one, and the call has no way to be given a bad argument. Runs in constant time and allocates nothing.
Returns: the calling process's identifier