Rizin
unix-like reverse engineering framework and cli tools
main.c File Reference
#include <stdio.h>
#include <uv.h>

Go to the source code of this file.

Functions

int main ()
 

Variables

uv_loop_tloop
 
uv_process_t child_req
 
uv_process_options_t options
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 9 of file main.c.

9  {
11 
12  char* args[3];
13  args[0] = "sleep";
14  args[1] = "100";
15  args[2] = NULL;
16 
18  options.file = "sleep";
19  options.args = args;
21 
22  int r;
23  if ((r = uv_spawn(loop, &child_req, &options))) {
24  fprintf(stderr, "%s\n", uv_strerror(r));
25  return 1;
26  }
27  fprintf(stderr, "Launched sleep with PID %d\n", child_req.pid);
29 
30  return uv_run(loop, UV_RUN_DEFAULT);
31 }
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
const char * file
Definition: uv.h:953
unsigned int flags
Definition: uv.h:975
char ** args
Definition: uv.h:960
uv_exit_cb exit_cb
Definition: uv.h:952
int pid
Definition: uv.h:1051
uv_process_options_t options
Definition: main.c:9
uv_loop_t * loop
Definition: main.c:7
uv_process_t child_req
Definition: main.c:8
struct Arg * args
Definition: mipsasm.c:18
@ UV_RUN_DEFAULT
Definition: uv.h:255
@ UV_PROCESS_DETACHED
Definition: uv.h:1025
UV_EXTERN int uv_spawn(uv_loop_t *loop, uv_process_t *handle, const uv_process_options_t *options)
Definition: process.c:408
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: core.c:365
UV_EXTERN void uv_unref(uv_handle_t *)
Definition: uv-common.c:552
UV_EXTERN const char * uv_strerror(int err)
Definition: uv-common.c:212
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition: uv-common.c:763

References uv_process_options_s::args, args, child_req, uv_process_options_s::exit_cb, uv_process_options_s::file, uv_process_options_s::flags, loop, NULL, options, uv_process_s::pid, r, uv_default_loop(), UV_PROCESS_DETACHED, uv_run(), UV_RUN_DEFAULT, uv_spawn(), uv_strerror(), and uv_unref().

Variable Documentation

◆ child_req

uv_process_t child_req

Definition at line 6 of file main.c.

◆ loop

uv_loop_t* loop

Definition at line 5 of file main.c.

◆ options

Definition at line 7 of file main.c.