| 340 | # endif |
| 341 | |
| 342 | pipe::pipe() { |
| 343 | int fds[2] = {}; |
| 344 | # ifdef _WIN32 |
| 345 | // Make the default pipe capacity same as on Linux 2.6.11+. |
| 346 | enum { DEFAULT_CAPACITY = 65536 }; |
| 347 | int result = FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY)); |
| 348 | # else |
| 349 | // Don't retry as the pipe function doesn't return EINTR. |
| 350 | // http://pubs.opengroup.org/onlinepubs/009696799/functions/pipe.html |
| 351 | int result = FMT_POSIX_CALL(pipe(fds)); |
| 352 | # endif |
| 353 | if (result != 0) |
| 354 | FMT_THROW(system_error(errno, FMT_STRING("cannot create pipe"))); |
| 355 | // The following assignments don't throw. |
| 356 | read_end = file(fds[0]); |
| 357 | write_end = file(fds[1]); |
| 358 | } |
| 359 | |
| 360 | # if !defined(__MSDOS__) |
| 361 | auto getpagesize() -> long { |
nothing calls this directly
no test coverage detected