blob: 16091ab6aaec6623989f1d05a1cff876bee49fca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef NULLMAILER__FORK_EXEC__H
#define NULLMAILER__FORK_EXEC__H
#include <sys/types.h>
#include <sys/wait.h>
#include "autoclose.h"
#define REDIRECT_NULL -2
#define REDIRECT_PIPE_FROM -3
#define REDIRECT_PIPE_TO -4
class fork_exec
{
private:
pid_t pid;
const char* name;
public:
fork_exec(const char*);
~fork_exec();
bool operator!() const;
bool start(const char* program, int redirn, int redirs[]);
bool wait();
int wait_status();
inline void kill(int sig) { ::kill(pid, sig); }
};
class queue_pipe : public fork_exec
{
public:
queue_pipe();
int start();
};
#endif
|