Lines Matching full:pipe
18 // Unidirectional pipe.
21 #include "Pipe.h"
45 Pipe::Pipe(void)
54 Pipe::~Pipe(void)
59 LOG(LOG_WARN, "pipe", "failed closing read handle (%ld)\n",
65 LOG(LOG_WARN, "pipe", "failed closing write handle (%ld)\n",
71 LOG(LOG_WARN, "pipe", "failed closing read fd (%d)\n",
76 LOG(LOG_WARN, "pipe", "failed closing write fd (%d)\n",
83 * Create the pipe.
87 bool Pipe::create(void)
102 LOG(LOG_ERROR, "pipe", "unable to create pipe\n");
111 if (pipe(fds) != 0) {
112 LOG(LOG_ERROR, "pipe", "unable to create pipe\n");
122 * Create a "half pipe". Please, no Segway riding.
124 bool Pipe::createReader(unsigned long handle)
132 * Create a "half pipe" for writing.
134 bool Pipe::createWriter(unsigned long handle)
144 bool Pipe::isCreated(void)
152 * Read data from the pipe.
157 int Pipe::read(void* buf, int count)
170 LOG(LOG_ERROR, "pipe", "PeekNamedPipe failed\n");
184 LOG(LOG_ERROR, "pipe", "ReadFile failed (err=%ld)\n", err);
199 * Write data to the pipe.
209 int Pipe::write(const void* buf, int count)
242 * from the pipe. They'll notice the read failure and do something
245 bool Pipe::readReady(void)
255 LOG(LOG_ERROR, "pipe", "PeekNamedPipe failed\n");
271 LOG(LOG_ERROR, "pipe", "select() failed\n");
280 LOG(LOG_ERROR, "pipe", "HUH? select() returned > 1\n");
289 * NOTE: the calls succeed under Mac OS X, but the pipe doesn't appear to
295 bool Pipe::setReadNonBlocking(bool val)
305 LOG(LOG_ERROR, "pipe", "couldn't get flags for pipe read fd\n");
313 LOG(LOG_ERROR, "pipe", "couldn't set flags for pipe read fd\n");
327 bool Pipe::setWriteNonBlocking(bool val)
337 LOG(LOG_WARN, "pipe",
338 "Warning: couldn't get flags for pipe write fd (errno=%d)\n",
347 LOG(LOG_WARN, "pipe",
348 "Warning: couldn't set flags for pipe write fd (errno=%d)\n",
363 bool Pipe::disallowReadInherit(void)
377 bool Pipe::disallowWriteInherit(void)
395 bool Pipe::closeRead(void)
403 LOG(LOG_WARN, "pipe", "failed closing read handle\n");
410 LOG(LOG_WARN, "pipe", "failed closing read fd\n");
422 bool Pipe::closeWrite(void)
430 LOG(LOG_WARN, "pipe", "failed closing write handle\n");
437 LOG(LOG_WARN, "pipe", "failed closing write fd\n");
449 unsigned long Pipe::getReadHandle(void)
459 unsigned long Pipe::getWriteHandle(void)