| 32 | namespace internal { |
| 33 | |
| 34 | Future<size_t> read(int_fd fd, void* data, size_t size) |
| 35 | { |
| 36 | process::initialize(); |
| 37 | |
| 38 | // TODO(benh): Let the system calls do what ever they're supposed to |
| 39 | // rather than return 0 here? |
| 40 | if (size == 0) { |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | // Just do a synchronous call. |
| 45 | if (!fd.is_overlapped()) { |
| 46 | ssize_t result = os::read(fd, data, size); |
| 47 | if (result == -1) { |
| 48 | return Failure(WindowsError().message); |
| 49 | } |
| 50 | return static_cast<size_t>(result); |
| 51 | } |
| 52 | |
| 53 | return windows::read(fd, data, size); |
| 54 | } |
| 55 | |
| 56 | Future<size_t> write(int_fd fd, const void* data, size_t size) |
| 57 | { |
no test coverage detected