| 245 | } |
| 246 | |
| 247 | file file::dup(int fd) { |
| 248 | // Don't retry as dup doesn't return EINTR. |
| 249 | // http://pubs.opengroup.org/onlinepubs/009695399/functions/dup.html |
| 250 | int new_fd = FMT_POSIX_CALL(dup(fd)); |
| 251 | if (new_fd == -1) |
| 252 | FMT_THROW(system_error(errno, "cannot duplicate file descriptor {}", fd)); |
| 253 | return file(new_fd); |
| 254 | } |
| 255 | |
| 256 | void file::dup2(int fd) { |
| 257 | int result = 0; |
nothing calls this directly
no test coverage detected