Current section
Files
Jump to
Current section
Files
edoc/execve-5.edoc
@doc execve(2): replace process image with environment
Replace the process image, specifying the environment for the new
process image.
== Examples ==
```
1> {ok, Drv} = alcove_drv:start().
{ok,<0.176.0>}
2> {ok, Pid} = alcove:fork(Drv, []).
{ok,29037}
3> alcove:execve(Drv, [Pid], "/usr/bin/env", ["env"], ["FOO=123"]).
ok
% Shell got {alcove_stdout,<0.176.0>,[29037],<<"FOO=123\n">>}
% Shell got {alcove_event,<0.176.0>,[29037],{exit_status,0}}
4> alcove:stdout(Drv, [Pid]).
[<<"FOO=123\n">>]
5> alcove:event(Drv, [Pid], 5000).
{exit_status,0}
ok
'''