Seastar
High performance C++ framework for concurrent servers
Classes | Public Types | Public Member Functions | List of all members
seastar::experimental::process Class Reference

Detailed Description

Interact with a spawned subprocess

Note
the spawned subprocess should always be wait()'ed. Otherwise, the Seastar application spawning the subprocess will leave us with one ore more zombie subprocesses after it exists.

#include <seastar/util/process.hh>

Classes

struct  wait_exited
 
struct  wait_signaled
 

Public Types

using wait_status = std::variant< wait_exited, wait_signaled >
 

Public Member Functions

 process (create_tag, pid_t pid, file_desc &&cin, file_desc &&cout, file_desc &&cerr)
 
output_stream< char > cin ()
 Return an writable stream which provides input from the child process.
 
input_stream< char > cout ()
 Return an writable stream which provides stdout output from the child process.
 
input_stream< char > cerr ()
 Return an writable stream which provides stderr output from the child process.
 
future< wait_status > wait ()
 
void terminate ()
 Stop the process using SIGTERM.
 
void kill ()
 Force the process to exit using SIGKILL.
 

Class Documentation

◆ seastar::experimental::process::wait_exited

struct seastar::experimental::process::wait_exited
Class Members
int exit_code

◆ seastar::experimental::process::wait_signaled

struct seastar::experimental::process::wait_signaled
Class Members
int terminating_signal

Member Function Documentation

◆ wait()

future<wait_status> seastar::experimental::process::wait ( )

Wait until the child process exits or terminates

Returns
the exit status

The documentation for this class was generated from the following file: