Apache Mesos
Classes | Public Types | Friends | List of all members
process::Subprocess::IO Class Reference

Describes how the I/O is redirected for stdin/stdout/stderr. More...

#include <subprocess.hpp>

Classes

struct  InputFileDescriptors
 For input file descriptors a child reads from the read file descriptor and a parent may write to the write file descriptor if one is present. More...
 
struct  OutputFileDescriptors
 For output file descriptors a child writes to the write file descriptor and a parent may read from the read file descriptor if one is present. More...
 

Public Types

enum  FDType { DUPLICATED, OWNED }
 Describes the lifecycle of a file descriptor passed into a subprocess via the Subprocess::FD helper. More...
 

Friends

class Subprocess
 
Try< Subprocesssubprocess (const std::string &path, std::vector< std::string > argv, const Subprocess::IO &in, const Subprocess::IO &out, const Subprocess::IO &err, const flags::FlagsBase *flags, const Option< std::map< std::string, std::string >> &environment, const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &clone, const std::vector< Subprocess::ParentHook > &parent_hooks, const std::vector< Subprocess::ChildHook > &child_hooks, const std::vector< int_fd > &whitelist_fds)
 

Detailed Description

Describes how the I/O is redirected for stdin/stdout/stderr.

One of the following three modes are supported:

  1. PIPE: Redirect to a pipe. The pipe will be created when launching a subprocess and the user can read/write the parent side of the pipe using Subprocess::in/out/err.
  2. PATH: Redirect to a file. For stdout/stderr, the file will be created if it does not exist. If the file exists, it will be appended.
  3. FD: Redirect to an open file descriptor.

Member Enumeration Documentation

Describes the lifecycle of a file descriptor passed into a subprocess via the Subprocess::FD helper.

Enumerator
DUPLICATED 

The file descriptor is duplicated before being passed to the subprocess.

The original file descriptor remains open.

OWNED 

The file descriptor is not duplicated before being passed to the subprocess.

Upon spawning the subprocess, the original file descriptor is closed in the parent and remains open in the child.

Friends And Related Function Documentation

friend class Subprocess
friend
Try<Subprocess> subprocess ( const std::string &  path,
std::vector< std::string >  argv,
const Subprocess::IO in,
const Subprocess::IO out,
const Subprocess::IO err,
const flags::FlagsBase flags,
const Option< std::map< std::string, std::string >> &  environment,
const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &  clone,
const std::vector< Subprocess::ParentHook > &  parent_hooks,
const std::vector< Subprocess::ChildHook > &  child_hooks,
const std::vector< int_fd > &  whitelist_fds 
)
friend

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