libzypp: zypp-core/zyppng/io/private/forkspawnengine_p.h Source File

libzypp 17.36.6

forkspawnengine_p.h
Go to the documentation of this file.
1#ifndef ZYPPNG_IO_PRIVATE_FORKSPAWNENGINE_H
2#define ZYPPNG_IO_PRIVATE_FORKSPAWNENGINE_H
3
4#include "abstractspawnengine_p.h"
5#include <glib.h>
6
7namespace zyppng {
8
9 class AbstractDirectSpawnEngine : public AbstractSpawnEngine
10 {
11 public:
12 ~AbstractDirectSpawnEngine() override;
13
14 bool isRunning ( bool wait = false ) override;
15 bool waitForExit ( const std::optional<uint64_t> &timeout = {} ) override;
16
17 protected:
18 void mapExtraFds( int controlFd = -1 );
19 void resetSignals();
20 };
21
26 class ForkSpawnEngine : public AbstractDirectSpawnEngine
27 {
28 public:
29 bool start( const char *const *argv, int stdin_fd, int stdout_fd, int stderr_fd ) override;
30 bool usePty () const;
31 void setUsePty ( const bool set = true );
32
33 private:
38 bool _use_pty = false;
39 };
40
41#if GLIB_CHECK_VERSION( 2, 58, 0)
42
43#define ZYPP_HAS_GLIBSPAWNENGINE 1
44
50 class GlibSpawnEngine : public AbstractDirectSpawnEngine
51 {
52 public:
53 bool start( const char *const *argv, int stdin_fd, int stdout_fd, int stderr_fd ) override;
54
55 private:
56 static void glibSpawnCallback ( void *data );
57 };
58
59#else
60 #define ZYPP_HAS_GLIBSPAWNENGINE 0
61#endif
62
63}
64
65
66#endif //
abstractspawnengine_p.h
zyppng::AbstractDirectSpawnEngine
Definition forkspawnengine_p.h:10
zyppng::AbstractDirectSpawnEngine::~AbstractDirectSpawnEngine
~AbstractDirectSpawnEngine() override
Definition forkspawnengine.cc:35
zyppng::AbstractDirectSpawnEngine::resetSignals
void resetSignals()
Definition forkspawnengine.cc:216
zyppng::AbstractDirectSpawnEngine::isRunning
bool isRunning(bool wait=false) override
Definition forkspawnengine.cc:44
zyppng::AbstractDirectSpawnEngine::waitForExit
bool waitForExit(const std::optional< uint64_t > &timeout={}) override
Definition forkspawnengine.cc:67
zyppng::AbstractDirectSpawnEngine::mapExtraFds
void mapExtraFds(int controlFd=-1)
Definition forkspawnengine.cc:136
zyppng::AbstractSpawnEngine::AbstractSpawnEngine
AbstractSpawnEngine()
Definition abstractspawnengine.cc:57
zyppng::ForkSpawnEngine
Definition forkspawnengine_p.h:27
zyppng::ForkSpawnEngine::_use_pty
bool _use_pty
Set to true, if a pair of ttys is used for communication instead of a pair of pipes.
Definition forkspawnengine_p.h:38
zyppng::ForkSpawnEngine::start
bool start(const char *const *argv, int stdin_fd, int stdout_fd, int stderr_fd) override
Definition forkspawnengine.cc:234
zyppng::ForkSpawnEngine::usePty
bool usePty() const
Definition forkspawnengine.cc:459
zyppng::ForkSpawnEngine::setUsePty
void setUsePty(const bool set=true)
Definition forkspawnengine.cc:464
zyppng
Definition MediaCurl2.h:22