Skip to content
CryoCryo home
StdlibSystem

process

Subprocess spawning. Cross-platform: fork + execvp on POSIX, CreateProcess on Windows, selected by target.

public module process::signal;
public module process::child;
public module process::command;
public module process::exec;
FileWhat it holdsImport
commandCommand, Stdio, Outputimport std::process::command;
childChild, ExitStatus, the piped ChildStdin / ChildStdout / ChildStderrimport std::process::child;
signalSignal, SigNoimport std::process::signal;
execshell, one command line through the platform shellimport std::process::exec;

The current process

function id() -> i32;

The current process's OS process id (pid). On POSIX this is getpid(); on Windows it is GetCurrentProcessId(), both surfaced through libc::getpid.

id() is the current process's pid — getpid() on POSIX, GetCurrentProcessId() on Windows. It lives at the root of the module: import std::process;.