Add supervisor node creation

This commit is contained in:
Jon Siwek 2019-10-16 20:10:25 -07:00
parent 7c08488dfc
commit 573e127672
5 changed files with 115 additions and 35 deletions

View file

@ -66,4 +66,34 @@ private:
int status_flags[2];
};
class PipePair {
public:
PipePair(int flags, int status_flags, int* fds = nullptr);
Pipe& In()
{ return pipes[swapped]; }
Pipe& Out()
{ return pipes[!swapped]; }
const Pipe& In() const
{ return pipes[swapped]; }
const Pipe& Out() const
{ return pipes[!swapped]; }
int InFD() const
{ return In().ReadFD(); }
int OutFD() const
{ return Out().WriteFD(); }
void Swap()
{ swapped = ! swapped; }
Pipe pipes[2];
bool swapped = false;
};
} // namespace bro