mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
* Wrapper class around pids.
This commit is contained in:
parent
155d7c8dfa
commit
c9fbd2dfd5
4 changed files with 162 additions and 87 deletions
|
|
@ -172,6 +172,7 @@ public:
|
|||
void cancel();
|
||||
};
|
||||
|
||||
|
||||
class AutoCloseFD
|
||||
{
|
||||
int fd;
|
||||
|
|
@ -185,6 +186,7 @@ public:
|
|||
bool isOpen();
|
||||
};
|
||||
|
||||
|
||||
class Pipe
|
||||
{
|
||||
public:
|
||||
|
|
@ -192,6 +194,7 @@ public:
|
|||
void create();
|
||||
};
|
||||
|
||||
|
||||
class AutoCloseDir
|
||||
{
|
||||
DIR * dir;
|
||||
|
|
@ -204,6 +207,21 @@ public:
|
|||
};
|
||||
|
||||
|
||||
class Pid
|
||||
{
|
||||
pid_t pid;
|
||||
bool separatePG;
|
||||
public:
|
||||
Pid();
|
||||
~Pid();
|
||||
void operator =(pid_t pid);
|
||||
operator pid_t();
|
||||
void kill();
|
||||
int wait(bool block);
|
||||
void setSeparatePG(bool separatePG);
|
||||
};
|
||||
|
||||
|
||||
/* User interruption. */
|
||||
|
||||
extern volatile sig_atomic_t _isInterrupted;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue