Add supervisor stem process auto-revival

This commit is contained in:
Jon Siwek 2019-10-04 13:25:01 -07:00
parent 4959d438fa
commit 52f7647f25
5 changed files with 285 additions and 93 deletions

View file

@ -13,9 +13,12 @@ public:
* @param flags1 file descriptor flags to set on write end of pipe.
* @param status_flags0 descriptor status flags to set on read end of pipe.
* @param status_flags1 descriptor status flags to set on write end of pipe.
* @param fds may be supplied to open an existing file descriptors rather
* than create ones from a new pipe. Should point to memory containing
* two consecutive file descriptors, the "read" one and then the "write" one.
*/
explicit Pipe(int flags0 = 0, int flags1 = 0, int status_flags0 = 0,
int status_flags1 = 0);
int status_flags1 = 0, int* fds = nullptr);
/**
* Close the pair of file descriptors owned by the object.
@ -45,9 +48,22 @@ public:
int WriteFD() const
{ return fds[1]; }
/**
* Sets the given file descriptor flags for both the read and write end
* of the pipe.
*/
void SetFlags(int flags);
/**
* Unsets the given file descriptor flags for both the read and write end
* of the pipe.
*/
void UnsetFlags(int flags);
private:
int fds[2];
int flags[2];
int status_flags[2];
};
} // namespace bro