9 reader(read_handle, 1024)
22 signal_flush_required.emit();
23 sys_close(read_handle);
24 sys_close(write_handle);
27 void Pipe::set_mode(Mode m)
31 throw invalid_argument("Pipe::set_mode");
35 Mode close = mode&M_RDWR&~m;
37 sys_close(read_handle);
39 sys_close(write_handle);
40 mode = (mode&~M_RDWR)|m;
43 void Pipe::set_block(bool b)
45 adjust_mode(mode, M_NONBLOCK, !b);
47 sys_set_blocking(read_handle, b);
49 sys_set_blocking(write_handle, b);
52 void Pipe::set_inherit(bool i)
54 adjust_mode(mode, M_INHERIT, i);
56 sys_set_inherit(read_handle, i);
58 sys_set_inherit(write_handle, i);
61 size_t Pipe::do_write(const char *buf, size_t size)
66 return sys_write(write_handle, buf, size);
69 size_t Pipe::do_read(char *buf, size_t size)
74 size_t ret = reader.read(buf, size);
81 const Handle &Pipe::get_handle(Mode m)
88 throw invalid_argument("Pipe::get_handle");