libzypp 17.37.17
zyppng::ForkSpawnEngine Class Reference

#include <zypp-core/zyppng/io/private/forkspawnengine_p.h>

Inheritance diagram for zyppng::ForkSpawnEngine:

Public Member Functions

bool start (const char *const *argv, int stdin_fd, int stdout_fd, int stderr_fd) override
bool usePty () const
void setUsePty (const bool set=true)
Public Member Functions inherited from zyppng::AbstractDirectSpawnEngine
 ~AbstractDirectSpawnEngine () override
bool isRunning (bool wait=false) override
bool waitForExit (const std::optional< uint64_t > &timeout={}) override
Public Member Functions inherited from zyppng::AbstractSpawnEngine
 AbstractSpawnEngine ()
virtual ~AbstractSpawnEngine ()
int exitStatus () const
void setExitStatus (const int state)
const std::string & executedCommand () const
const std::string & execError () const
void setExecError (const std::string &str)
zypp::Pathname chroot () const
void setChroot (const zypp::Pathname &chroot)
bool useDefaultLocale () const
void setUseDefaultLocale (bool defaultLocale)
Environment environment () const
void setEnvironment (const Environment &environment)
pid_t pid ()
virtual void notifyExited (int status)
bool dieWithParent () const
void setDieWithParent (bool dieWithParent)
bool switchPgid () const
void setSwitchPgid (bool switchPgid)
zypp::Pathname workingDirectory () const
void setWorkingDirectory (const zypp::Pathname &workingDirectory)
const std::vector< int > & fdsToMap () const
void addFd (int fd)
int checkStatus (int status)

Private Attributes

bool _use_pty = false
 Set to true, if a pair of ttys is used for communication instead of a pair of pipes.

Additional Inherited Members

Public Types inherited from zyppng::AbstractSpawnEngine
using Environment = std::map<std::string,std::string>
 For passing additional environment variables to set.
Static Public Member Functions inherited from zyppng::AbstractSpawnEngine
static std::unique_ptr< zyppng::AbstractSpawnEnginecreateDefaultEngine ()
Protected Member Functions inherited from zyppng::AbstractDirectSpawnEngine
void mapExtraFds (int controlFd=-1)
void resetSignals ()
Protected Attributes inherited from zyppng::AbstractSpawnEngine
bool _useDefaultLocale = false
bool _dieWithParent = false
 Should the process die with the parent process.
bool _switchPgid = false
pid_t _pid = -1
int _exitStatus = 0
std::string _execError
 Remember execution errors like failed fork/exec.
std::string _executedCommand
 Store the command we're executing.
std::vector< std::string > _args
 The arguments we want to pass to the program.
Environment _environment
 Environment variables to set in the new process.
zypp::Pathname _chroot
 Path to chroot into.
zypp::Pathname _workingDirectory
 Working directory.
std::vector< int > _mapFds
 Additional file descriptors we want to map to the new process.

Detailed Description

Definition at line 26 of file forkspawnengine_p.h.

Member Function Documentation

◆ start()

bool zyppng::ForkSpawnEngine::start ( const char *const * argv,
int stdin_fd,
int stdout_fd,
int stderr_fd )
overridevirtual

Kickstart the process, if this returns true it is guaranteed that exec() was successful

Implements zyppng::AbstractSpawnEngine.

Definition at line 234 of file forkspawnengine.cc.

◆ usePty()

bool zyppng::ForkSpawnEngine::usePty ( ) const

Definition at line 459 of file forkspawnengine.cc.

◆ setUsePty()

void zyppng::ForkSpawnEngine::setUsePty ( const bool set = true)

Definition at line 464 of file forkspawnengine.cc.

Member Data Documentation

◆ _use_pty

bool zyppng::ForkSpawnEngine::_use_pty = false
private

Set to true, if a pair of ttys is used for communication instead of a pair of pipes.

Definition at line 38 of file forkspawnengine_p.h.


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