MCPcopy Create free account
hub / github.com/apache/mesos / read

Function read

3rdparty/libprocess/src/windows/io.cpp:49–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47namespace internal {
48
49Future<size_t> read(int_fd fd, void* data, size_t size, bool bypassZeroRead)
50{
51 process::initialize();
52
53 // TODO(benh): Let the system calls do what ever they're supposed to
54 // rather than return 0 here?
55 if (size == 0 && bypassZeroRead) {
56 return 0;
57 }
58
59 // Just do a synchronous call.
60 if (!fd.is_overlapped()) {
61 ssize_t result = os::read(fd, data, size);
62 if (result == -1) {
63 return Failure(WindowsError().message);
64 }
65 return static_cast<size_t>(result);
66 }
67
68 return windows::read(fd, data, size);
69}
70
71Future<size_t> write(int_fd fd, const void* data, size_t size)
72{

Callers 2

pollFunction · 0.70
recvMethod · 0.70

Calls 4

FailureClass · 0.85
WindowsErrorClass · 0.85
is_overlappedMethod · 0.80
initializeFunction · 0.50

Tested by

no test coverage detected