MCPcopy Create free account
hub / github.com/3rdparty/libprocess / write

Function write

src/windows/io.cpp:56–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56Future<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
79Try<Nothing> prepare_async(int_fd fd)

Callers 1

sendMethod · 0.70

Calls 2

FailureClass · 0.85
initializeFunction · 0.50

Tested by

no test coverage detected