View Source alcove_drv (alcove v1.0.0)

Summary

Types

ref/0

-type ref() :: pid().

Functions

call(Drv, Pids, Command, Argv, Timeout)

-spec call(ref(), [alcove:pid_t()], atom(), list(), timeout()) -> term().

code_change(OldVsn, State, Extra)

event(Drv, Pids, Timeout)

-spec event(ref(), [alcove:pid_t()], timeout()) -> term().

getopts(Options0)

-spec getopts(proplists:proplist()) -> [string() | [string()]].

handle_call(_, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(_)

port(Drv)

-spec port(ref()) -> port().

progname()

-spec progname() -> string().

raw(Drv)

-spec raw(ref()) -> ok.

start()

-spec start() -> ignore | {error, _} | {ok, pid()}.

Create the alcove port using the default options

start(Options)

-spec start(proplists:proplist()) -> ignore | {error, _} | {ok, pid()}.

Create the alcove port

See start_link/1 for options.

start(Owner, Options)

-spec start(pid(), proplists:proplist()) -> ignore | {error, _} | {ok, pid()}.

start_link()

-spec start_link() -> ignore | {error, _} | {ok, pid()}.

Create and link against the alcove port using the default options

start_link(Options)

-spec start_link(proplists:proplist()) -> ignore | {error, _} | {ok, pid()}.

Create and link against the alcove port

Create the alcove port.

* stderr_to_stdout

The behaviour of stderr from the port differs from child processes. Standard error from the port goes to the console while stderr from child processes is tagged and sent to the controlling Erlang process.

This option merges stderr and stdout from the port. Since stdout is used for communicating with the Erlang side and is tagged with a header, this will likely mess things up.

Only use this option if you want to call execvp/3,4 in the port.

* {env, [{Key,Val}]}

Set the environment for the port.

* {exec, Exec}

Default: ""

Sets a command to run the port, such as sudo.

* {progname, Path}

Default: priv/alcove

Sets the path to the alcove executable.

* {ctldir, Path}

Default: priv

Sets the path to the alcove control directory. The directory must be writable by the alcove user.

For the remaining options, see alcove:getopt/2,3.

start_link(Owner, Options)

-spec start_link(pid(), proplists:proplist()) -> ignore | {error, _} | {ok, pid()}.

stderr(Drv, Pids, Timeout)

-spec stderr(ref(), [alcove:pid_t()], timeout()) ->
                false | binary() | {alcove_error, any()} | {alcove_pipe, integer()}.

stdin(Drv, Pids, Data)

-spec stdin(ref(), [alcove:pid_t()], iodata()) -> ok | {alcove_error, badarg}.

stdout(Drv, Pids, Timeout)

-spec stdout(ref(), [alcove:pid_t()], timeout()) ->
                false | binary() | {alcove_error, any()} | {alcove_pipe, integer()}.

stop(Drv)

-spec stop(ref()) -> ok.

terminate(Reason, State)