| 54 | } |
| 55 | |
| 56 | Future<size_t> write(int_fd fd, const void* data, size_t size) |
| 57 | { |
| 58 | process::initialize(); |
| 59 | |
| 60 | // TODO(benh): Let the system calls do what ever they're supposed to |
| 61 | // rather than return 0 here? |
| 62 | if (size == 0) { |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | // Just do a synchronous call. |
| 67 | if (!fd.is_overlapped()) { |
| 68 | ssize_t result = os::write(fd, data, size); |
| 69 | if (result == -1) { |
| 70 | return Failure(WindowsError().message); |
| 71 | } |
| 72 | return static_cast<size_t>(result); |
| 73 | } |
| 74 | |
| 75 | return windows::write(fd, data, size); |
| 76 | } |
| 77 | |
| 78 | |
| 79 | Try<Nothing> prepare_async(int_fd fd) |
no test coverage detected