ProcCreate
Description
Create a new process
Parameters
| Name | Direction | Description |
|---|---|---|
path |
in | Path to executable to be executed. |
argv |
in | NULL terminated array containing zero-terminated strings. |
envp |
in | NULL terminated array containing zero-terminated strings. |
alloc |
in | Allocator used to allocate the returned Proc handle. The same allocator must be passed to ProcDestroy. |
Success
New created Proc object opaque handle.
Failure
NULL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Proc.c:69:
#define WRITE_END 1
Proc *ProcCreate(const char *filepath, char **argv, char **envp, Allocator *alloc) {
if (!alloc) {
LOG_FATAL("ProcCreate requires an allocator");- In
Proc.c:71:
Proc *ProcCreate(const char *filepath, char **argv, char **envp, Allocator *alloc) {
if (!alloc) {
LOG_FATAL("ProcCreate requires an allocator");
}
#if defined(__APPLE__) || defined(__linux__)- In
SubProcComm.c:14:
// create a new child process
Proc *proc = ProcCreate(argv[1], argv + 1, envp, &alloc.base);
// write something to it's stdout
Last updated on