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

Macros

#define KILL_TIMEOUT_MS   2000
 

Functions

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...
 

Macro Definition Documentation

#define KILL_TIMEOUT_MS   2000

Function Documentation

void process_close_streams ( Process proc)
int process_spawn ( Process proc,
bool  in,
bool  out,
bool  err 
)
Returns
zero on success, or negative error code
void process_stop ( Process proc)

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

void process_teardown ( Loop loop)
int process_wait ( Process proc,
int  ms,
MultiQueue events 
)

Synchronously wait for a process to finish

Parameters
processProcess instance
msTime in milliseconds to wait for the process. 0 for no wait. -1 to wait until the process quits.
Returns
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.