Macros | Functions | Variables
test-spawn.c File Reference
#include "uv.h"
#include "task.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
Include dependency graph for test-spawn.c:

Go to the source code of this file.

Macros

#define OUTPUT_SIZE   1024
 

Functions

static void close_cb (uv_handle_t *handle)
 
static void detach_failure_cb (uv_process_t *process, int64_t exit_status, int term_signal)
 
static void exit_cb (uv_process_t *process, int64_t exit_status, int term_signal)
 
static void fail_cb (uv_process_t *process, int64_t exit_status, int term_signal)
 
static void init_process_options (char *test, uv_exit_cb exit_cb)
 
static void kill_cb (uv_process_t *process, int64_t exit_status, int term_signal)
 
static int mpipe (int *fds)
 
static void on_alloc (uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
 
static void on_read (uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
 
static void on_read_once (uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
 
void spawn_stdin_stdout (void)
 
int spawn_tcp_server_helper (void)
 
 TEST_IMPL (closed_fd_events)
 
 TEST_IMPL (kill)
 
 TEST_IMPL (spawn_and_kill)
 
 TEST_IMPL (spawn_and_kill_with_std)
 
 TEST_IMPL (spawn_and_ping)
 
 TEST_IMPL (spawn_auto_unref)
 
 TEST_IMPL (spawn_closed_process_io)
 
 TEST_IMPL (spawn_detached)
 
 TEST_IMPL (spawn_empty_env)
 
 TEST_IMPL (spawn_exit_code)
 
 TEST_IMPL (spawn_fails)
 
 TEST_IMPL (spawn_fails_check_for_waitpid_cleanup)
 
 TEST_IMPL (spawn_fs_open)
 
 TEST_IMPL (spawn_ignored_stdio)
 
 TEST_IMPL (spawn_inherit_streams)
 
 TEST_IMPL (spawn_preserve_env)
 
 TEST_IMPL (spawn_quoted_path)
 
 TEST_IMPL (spawn_reads_child_path)
 
 TEST_IMPL (spawn_same_stdout_stderr)
 
 TEST_IMPL (spawn_setgid_fails)
 
 TEST_IMPL (spawn_setuid_fails)
 
 TEST_IMPL (spawn_setuid_setgid)
 
 TEST_IMPL (spawn_stdin)
 
 TEST_IMPL (spawn_stdio_greater_than_3)
 
 TEST_IMPL (spawn_stdout)
 
 TEST_IMPL (spawn_stdout_and_stderr_to_file)
 
 TEST_IMPL (spawn_stdout_and_stderr_to_file2)
 
 TEST_IMPL (spawn_stdout_and_stderr_to_file_swap)
 
 TEST_IMPL (spawn_stdout_to_file)
 
 TEST_IMPL (spawn_tcp_server)
 
static void timer_cb (uv_timer_t *handle)
 
static void timer_counter_cb (uv_timer_t *handle)
 
static void write_cb (uv_write_t *req, int status)
 

Variables

static char * args [5]
 
static int close_cb_called
 
static char exepath [1024]
 
static size_t exepath_size = 1024
 
static int exit_cb_called
 
static int no_term_signal
 
static uv_process_options_t options
 
static char output [OUTPUT_SIZE]
 
static int output_used
 
static uv_process_t process
 
static uv_tcp_t tcp_server
 
static uv_timer_t timer
 
static int timer_counter
 

Macro Definition Documentation

◆ OUTPUT_SIZE

#define OUTPUT_SIZE   1024

Definition at line 57 of file test-spawn.c.

Function Documentation

◆ close_cb()

static void close_cb ( uv_handle_t handle)
static

Definition at line 62 of file test-spawn.c.

◆ detach_failure_cb()

static void detach_failure_cb ( uv_process_t process,
int64_t  exit_status,
int  term_signal 
)
static

Definition at line 118 of file test-spawn.c.

◆ exit_cb()

static void exit_cb ( uv_process_t process,
int64_t  exit_status,
int  term_signal 
)
static

Definition at line 67 of file test-spawn.c.

◆ fail_cb()

static void fail_cb ( uv_process_t process,
int64_t  exit_status,
int  term_signal 
)
static

Definition at line 78 of file test-spawn.c.

◆ init_process_options()

static void init_process_options ( char *  test,
uv_exit_cb  exit_cb 
)
static

Definition at line 157 of file test-spawn.c.

◆ kill_cb()

static void kill_cb ( uv_process_t process,
int64_t  exit_status,
int  term_signal 
)
static

Definition at line 85 of file test-spawn.c.

◆ mpipe()

static int mpipe ( int fds)
static

Definition at line 1750 of file test-spawn.c.

◆ on_alloc()

static void on_alloc ( uv_handle_t handle,
size_t  suggested_size,
uv_buf_t buf 
)
static

Definition at line 125 of file test-spawn.c.

◆ on_read()

static void on_read ( uv_stream_t tcp,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 133 of file test-spawn.c.

◆ on_read_once()

static void on_read_once ( uv_stream_t tcp,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 144 of file test-spawn.c.

◆ spawn_stdin_stdout()

void spawn_stdin_stdout ( void  )

Definition at line 1892 of file test-spawn.c.

◆ spawn_tcp_server_helper()

int spawn_tcp_server_helper ( void  )

Definition at line 661 of file test-spawn.c.

◆ TEST_IMPL() [1/30]

TEST_IMPL ( closed_fd_events  )

Definition at line 1622 of file test-spawn.c.

◆ TEST_IMPL() [2/30]

TEST_IMPL ( kill  )

Definition at line 1040 of file test-spawn.c.

◆ TEST_IMPL() [3/30]

TEST_IMPL ( spawn_and_kill  )

Definition at line 761 of file test-spawn.c.

◆ TEST_IMPL() [4/30]

TEST_IMPL ( spawn_and_kill_with_std  )

Definition at line 855 of file test-spawn.c.

◆ TEST_IMPL() [5/30]

TEST_IMPL ( spawn_and_ping  )

Definition at line 914 of file test-spawn.c.

◆ TEST_IMPL() [6/30]

TEST_IMPL ( spawn_auto_unref  )

Definition at line 1569 of file test-spawn.c.

◆ TEST_IMPL() [7/30]

TEST_IMPL ( spawn_closed_process_io  )

Definition at line 1008 of file test-spawn.c.

◆ TEST_IMPL() [8/30]

TEST_IMPL ( spawn_detached  )

Definition at line 826 of file test-spawn.c.

◆ TEST_IMPL() [9/30]

TEST_IMPL ( spawn_empty_env  )

Definition at line 235 of file test-spawn.c.

◆ TEST_IMPL() [10/30]

TEST_IMPL ( spawn_exit_code  )

Definition at line 264 of file test-spawn.c.

◆ TEST_IMPL() [11/30]

TEST_IMPL ( spawn_fails  )

Definition at line 187 of file test-spawn.c.

◆ TEST_IMPL() [12/30]

TEST_IMPL ( spawn_fails_check_for_waitpid_cleanup  )

Definition at line 205 of file test-spawn.c.

◆ TEST_IMPL() [13/30]

TEST_IMPL ( spawn_fs_open  )

Definition at line 1583 of file test-spawn.c.

◆ TEST_IMPL() [14/30]

TEST_IMPL ( spawn_ignored_stdio  )

Definition at line 739 of file test-spawn.c.

◆ TEST_IMPL() [15/30]

TEST_IMPL ( spawn_inherit_streams  )

Definition at line 1781 of file test-spawn.c.

◆ TEST_IMPL() [16/30]

TEST_IMPL ( spawn_preserve_env  )

Definition at line 786 of file test-spawn.c.

◆ TEST_IMPL() [17/30]

TEST_IMPL ( spawn_quoted_path  )

Definition at line 1865 of file test-spawn.c.

◆ TEST_IMPL() [18/30]

TEST_IMPL ( spawn_reads_child_path  )

Definition at line 1680 of file test-spawn.c.

◆ TEST_IMPL() [19/30]

TEST_IMPL ( spawn_same_stdout_stderr  )

Definition at line 961 of file test-spawn.c.

◆ TEST_IMPL() [20/30]

TEST_IMPL ( spawn_setgid_fails  )

Definition at line 1471 of file test-spawn.c.

◆ TEST_IMPL() [21/30]

TEST_IMPL ( spawn_setuid_fails  )

Definition at line 1420 of file test-spawn.c.

◆ TEST_IMPL() [22/30]

TEST_IMPL ( spawn_setuid_setgid  )

Definition at line 1376 of file test-spawn.c.

◆ TEST_IMPL() [23/30]

TEST_IMPL ( spawn_stdin  )

Definition at line 583 of file test-spawn.c.

◆ TEST_IMPL() [24/30]

TEST_IMPL ( spawn_stdio_greater_than_3  )

Definition at line 626 of file test-spawn.c.

◆ TEST_IMPL() [25/30]

TEST_IMPL ( spawn_stdout  )

Definition at line 283 of file test-spawn.c.

◆ TEST_IMPL() [26/30]

TEST_IMPL ( spawn_stdout_and_stderr_to_file  )

Definition at line 370 of file test-spawn.c.

◆ TEST_IMPL() [27/30]

TEST_IMPL ( spawn_stdout_and_stderr_to_file2  )

Definition at line 426 of file test-spawn.c.

◆ TEST_IMPL() [28/30]

TEST_IMPL ( spawn_stdout_and_stderr_to_file_swap  )

Definition at line 491 of file test-spawn.c.

◆ TEST_IMPL() [29/30]

TEST_IMPL ( spawn_stdout_to_file  )

Definition at line 316 of file test-spawn.c.

◆ TEST_IMPL() [30/30]

TEST_IMPL ( spawn_tcp_server  )

Definition at line 687 of file test-spawn.c.

◆ timer_cb()

static void timer_cb ( uv_timer_t handle)
static

Definition at line 174 of file test-spawn.c.

◆ timer_counter_cb()

static void timer_counter_cb ( uv_timer_t handle)
static

Definition at line 181 of file test-spawn.c.

◆ write_cb()

static void write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 151 of file test-spawn.c.

Variable Documentation

◆ args

char* args[5]
static

Definition at line 50 of file test-spawn.c.

◆ close_cb_called

int close_cb_called
static

Definition at line 43 of file test-spawn.c.

◆ exepath

char exepath[1024]
static

Definition at line 48 of file test-spawn.c.

◆ exepath_size

size_t exepath_size = 1024
static

Definition at line 49 of file test-spawn.c.

◆ exit_cb_called

int exit_cb_called
static

Definition at line 44 of file test-spawn.c.

◆ no_term_signal

int no_term_signal
static

Definition at line 51 of file test-spawn.c.

◆ options

uv_process_options_t options
static

Definition at line 47 of file test-spawn.c.

◆ output

char output[OUTPUT_SIZE]
static

Definition at line 58 of file test-spawn.c.

◆ output_used

int output_used
static

Definition at line 59 of file test-spawn.c.

◆ process

uv_process_t process
static

Definition at line 45 of file test-spawn.c.

◆ tcp_server

uv_tcp_t tcp_server
static

Definition at line 55 of file test-spawn.c.

◆ timer

uv_timer_t timer
static

Definition at line 46 of file test-spawn.c.

◆ timer_counter

int timer_counter
static

Definition at line 53 of file test-spawn.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:33