Macros | Functions
process.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <uv.h>
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/process.h"
#include "nvim/event/rstream.h"
#include "nvim/event/wstream.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/macros.h"
#include "nvim/os/process.h"
#include "nvim/os/pty_process.h"
#include "nvim/os/shell.h"


#define KILL_TIMEOUT_MS   2000


int process_spawn (Process *proc, bool in, bool out, bool err) FUNC_ATTR_NONNULL_ALL
void process_teardown (Loop *loop) FUNC_ATTR_NONNULL_ALL
void process_close_streams (Process *proc) FUNC_ATTR_NONNULL_ALL
int process_wait (Process *proc, int ms, MultiQueue *events) FUNC_ATTR_NONNULL_ARG(1)
void process_stop (Process *proc) FUNC_ATTR_NONNULL_ALL
 Ask a process to terminate and eventually kill if it doesn't respond. More...
void process_free (Process *proc) FUNC_ATTR_NONNULL_ALL
 Frees process-owned resources. More...

Macro Definition Documentation


#define KILL_TIMEOUT_MS   2000

Function Documentation

◆ process_close_streams()

void process_close_streams ( Process proc)

◆ process_free()

void process_free ( Process proc)

Frees process-owned resources.

◆ process_spawn()

int process_spawn ( Process proc,
bool  in,
bool  out,
bool  err 
zero on success, or negative error code

◆ process_stop()

void process_stop ( Process proc)

Ask a process to terminate and eventually kill if it doesn't respond.

◆ process_teardown()

void process_teardown ( Loop loop)

◆ process_wait()

int process_wait ( Process proc,
int  ms,
MultiQueue events 

Synchronously wait for a process to finish

processProcess instance
msTime in milliseconds to wait for the process. 0 for no wait. -1 to wait until the process quits.
Exit code of the process. proc->status will have the same value. -1 if the timeout expired while the process is still running. -2 if the user interrupted the wait.