Alien-uv

 view release on metacpan or  search on metacpan

libuv/docs/src/process.rst  view on Meta::CPAN


.. c:member:: uv_process_options_t.env

    Environment for the new process. If NULL the parents environment is used.

.. c:member:: uv_process_options_t.cwd

    Current working directory for the subprocess.

.. c:member:: uv_process_options_t.flags

    Various flags that control how :c:func:`uv_spawn` behaves. See
    :c:type:`uv_process_flags`.

.. c:member:: uv_process_options_t.stdio_count
.. c:member:: uv_process_options_t.stdio

    The `stdio` field points to an array of :c:type:`uv_stdio_container_t`
    structs that describe the file descriptors that will be made available to
    the child process. The convention is that stdio[0] points to stdin,
    fd 1 is used for stdout, and fd 2 is stderr.

    .. note::
        On Windows file descriptors greater than 2 are available to the child process only if
        the child processes uses the MSVCRT runtime.

.. c:member:: uv_process_options_t.uid
.. c:member:: uv_process_options_t.gid

    Libuv can change the child process' user/group id. This happens only when
    the appropriate bits are set in the flags fields.

    .. note::
        This is not supported on Windows, :c:func:`uv_spawn` will fail and set the error
        to ``UV_ENOTSUP``.

.. c:member:: uv_stdio_container_t.flags

    Flags specifying how the stdio container should be passed to the child. See
    :c:type:`uv_stdio_flags`.

.. c:member:: uv_stdio_container_t.data

    Union containing either the stream or fd to be passed on to the child
    process.


API
---

.. c:function:: void uv_disable_stdio_inheritance(void)

    Disables inheritance for file descriptors / handles that this process
    inherited from its parent. The effect is that child processes spawned by
    this process don't accidentally inherit these handles.

    It is recommended to call this function as early in your program as possible,
    before the inherited file descriptors can be closed or duplicated.

    .. note::
        This function works on a best-effort basis: there is no guarantee that libuv can discover
        all file descriptors that were inherited. In general it does a better job on Windows than
        it does on Unix.

.. c:function:: int uv_spawn(uv_loop_t* loop, uv_process_t* handle, const uv_process_options_t* options)

    Initializes the process handle and starts the process. If the process is
    successfully spawned, this function will return 0. Otherwise, the
    negative error code corresponding to the reason it couldn't spawn is
    returned.

    Possible reasons for failing to spawn would include (but not be limited to)
    the file to execute not existing, not having permissions to use the setuid or
    setgid specified, or not having enough memory to allocate for the new
    process.

    .. versionchanged:: 1.24.0 Added `UV_PROCESS_WINDOWS_HIDE_CONSOLE` and
                        `UV_PROCESS_WINDOWS_HIDE_GUI` flags.

.. c:function:: int uv_process_kill(uv_process_t* handle, int signum)

    Sends the specified signal to the given process handle. Check the documentation
    on :c:ref:`signal` for signal support, specially on Windows.

.. c:function:: int uv_kill(int pid, int signum)

    Sends the specified signal to the given PID. Check the documentation
    on :c:ref:`signal` for signal support, specially on Windows.

.. c:function:: uv_pid_t uv_process_get_pid(const uv_process_t* handle)

    Returns `handle->pid`.

    .. versionadded:: 1.19.0

.. seealso:: The :c:type:`uv_handle_t` API functions also apply.



( run in 2.966 seconds using v1.01-cache-2.11-cpan-13bb782fe5a )