[Lldb-commits] [PATCH] Enable PipeWindows to support reading with timeout, and fix broken build of llgs.

Oleksiy Vyalov ovyalov at google.com
Thu Dec 4 14:15:14 PST 2014

I'm thinking about having Pipe class as a base class with derived AnonymousPipe and NamedPipe.

AnonymousPipe will be almost replica of existing Pipe class with custom Open(OpenOptions opts) method.
NamedPipe will have following own methods:

    enum OpenOptions
        eOpenOptionNonBlocking      = (1u << 0),  // Non-blocking reads
        eOpenChildProcessesInherit  = (1u << 1)   // Child processes inherit

explicit NamedPipe(const char* name);

bool Create(); //mkfifo
bool Delete(); //Close() & unlink

bool OpenReader(OpenOptions opts);
bool OpenWriter(OpenOptions opts);

For named pipes we don't need to have both reader & writer opened in the same processes - so, that's why I think we may need separate open methods.
In order to read with timeout pipe should be opened in non-blocking mode - on Windows you may use PIPE_NOWAIT if such option is set.


More information about the lldb-commits mailing list