class ref _ProcessPosix is _Process ref
new ref create( path: String val, args: Array[String val] val, vars: Array[String val] val, stdin: _Pipe ref, stdout: _Pipe ref, stderr: _Pipe ref) : _ProcessPosix ref^ ?
Terminate the process, first trying SIGTERM and if that fails, try SIGKILL.
fun box kill() : None val
fun ref wait() : I32 val
Convert an array of String parameters into an array of C pointers to same strings.
fun tag _make_argv( args: Array[String val] box) : Array[Pointer[U8 val] tag] ref
We are now in the child process. We redirect STDIN, STDOUT and STDERR to their pipes and execute the command. The command is executed via execve which does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded. We've set the FD_CLOEXEC flag on all file descriptors to ensure that they are all closed automatically once @execve gets called.
fun box _child_fork( path: String val, argp: Array[Pointer[U8 val] tag] ref, envp: Array[Pointer[U8 val] tag] ref, stdin: _Pipe ref, stdout: _Pipe ref, stderr: _Pipe ref) : None val
Creates a copy of the file descriptor oldfd using the file descriptor number specified in newfd. If the file descriptor newfd was previously open, it is silently closed before being reused. If dup2() fails because of EINTR we retry.
fun tag _dup2( oldfd: U32 val, newfd: U32 val) : None val
© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/process-_ProcessPosix