| 221 | } |
| 222 | |
| 223 | int opipe::flush(std::string_view data) |
| 224 | { |
| 225 | if (!opened()) |
| 226 | return report(EINVAL, "opipe::flush"); |
| 227 | if (!data.empty()) |
| 228 | if (auto err = write(data); err != 0) |
| 229 | return report(err, "opipe::write"); |
| 230 | if (auto res = std::fflush(file_); res != 0) |
| 231 | return report(errno, "fflush"); |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | int ipipe::read(std::string &data) |
| 236 | { |