131#define PROCESS_InvalidID ((ProcessID)-1)
137#define PROC_ExitCodeUnknown ((int32)-1)
152#define SType_ProcessInfo ProcessInfo*
153#define STStorageType_ProcessInfo ProcessInfo
154#define STypeArg_ProcessInfo(type, val) stgeneric(opaque, &(val))
155#define STypeArgPtr_ProcessInfo(type, val) &stgeneric(opaque, (val))
156#define STypeCheckedArg_ProcessInfo(type, val) stType(type), stArg(type, val)
157#define STypeCheckedPtrArg_ProcessInfo(type, val) stType(type), stArgPtr(type, val)
217bool procEnum(_Inout_ sa_ProcessInfo* out, flags_t flags);
238bool procFind(_Inout_ sa_ProcessInfo* out, _In_ strref name, flags_t flags);
430#define procRelease(pproc) objRelease(pproc)
Basic closure functionality.
bool procGetInfo(ProcessInfo *out, Process *proc, flags_t flags)
bool procTerminate(Process *proc, bool force)
void procNotifyCancel(Process *proc)
bool procEnum(sa_ProcessInfo *out, flags_t flags)
void procOptsUnsetEnv(ProcessOpts *opts, strref name)
bool procWait(Process *proc, int64 timeout)
Process * procLaunch(strref exe, sa_string args, ProcessOpts *opts)
void procOptsSetEnv(ProcessOpts *opts, strref name, strref val)
void procOptsInit(ProcessOpts *opts)
void procInfoCopy(ProcessInfo *dest, const ProcessInfo *src)
void procInfoDestroy(ProcessInfo *info)
bool procExePath(Process *proc, string *out)
ProcessID procCurrentID(void)
bool procNotifyExit(Process *proc, closure cls)
void procOptsDestroy(ProcessOpts *opts)
ProcLaunchFlags
Flags for procLaunch()
bool procRunning(Process *proc)
bool procName(Process *proc, string *out)
bool procExitCode(Process *proc, int32 *code)
Process * procOpen(ProcessID pid)
bool procFind(sa_ProcessInfo *out, strref name, flags_t flags)
enum ProcStdioEnum ProcStdio
Where a launched process's standard input, output and error go.
bool procGetInfoByID(ProcessInfo *out, ProcessID pid, flags_t flags)
int64 ProcessID
Operating system process id.
ProcEnumFlags
Flags for procEnum() and procFind()
ProcessID procID(Process *proc)
ProcStdioEnum
Where a launched process's standard input, output and error go.
void procInfoInit(ProcessInfo *info)
@ PROC_Detached
Put the child in its own session so it outlives the caller.
@ PROC_NewGroup
Give the child its own process group, so it can be signalled as a group.
@ PROC_NewConsole
Windows: give the child its own console window. Ignored elsewhere.
@ PROC_NoWindow
Windows: do not give the child a console window. Ignored elsewhere.
@ PROC_EnumFullPath
Also resolve each process's full executable path.
@ PROC_StdioNull
The child's stdio is discarded (/dev/null, or NUL on Windows)
@ PROC_StdioInherit
The child shares the caller's stdin, stdout and stderr.
@ PROC_StdioFile
The child's stdout and stderr both go to ProcessOpts::stdioPath.
Hash table container with type-safe generic key-value storage.
Dynamic arrays with type-safe generic programming.
ProcessID pid
Process id; always present.
ProcessID ppid
Parent process id, or PROCESS_InvalidID if it could not be read.
string name
Process name; always present.
string exepath
Full path to the executable, or empty if it could not be read.
string workdir
Directory to start the child in; empty inherits the caller's.
flags_t flags
ProcLaunchFlags.
hashtable env
Variables to set in the child, name to value.
sa_string envUnset
Variables to remove from the child.
ProcStdio stdio
What to do with the child's stdin, stdout and stderr.
string stdioPath
File for PROC_StdioFile; required in that mode, ignored otherwise.