| 69 | } |
| 70 | |
| 71 | Future<size_t> write(int_fd fd, const void* data, size_t size) |
| 72 | { |
| 73 | process::initialize(); |
| 74 | |
| 75 | // TODO(benh): Let the system calls do what ever they're supposed to |
| 76 | // rather than return 0 here? |
| 77 | if (size == 0) { |
| 78 | return 0; |
| 79 | } |
| 80 | |
| 81 | // Just do a synchronous call. |
| 82 | if (!fd.is_overlapped()) { |
| 83 | ssize_t result = os::write(fd, data, size); |
| 84 | if (result == -1) { |
| 85 | return Failure(WindowsError().message); |
| 86 | } |
| 87 | return static_cast<size_t>(result); |
| 88 | } |
| 89 | |
| 90 | return windows::write(fd, data, size); |
| 91 | } |
| 92 | |
| 93 | |
| 94 | Try<Nothing> prepare_async(int_fd fd) |
no test coverage detected