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

Function read

src/windows/io.cpp:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace internal {
33
34Future<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
56Future<size_t> write(int_fd fd, const void* data, size_t size)
57{

Callers 1

recvMethod · 0.70

Calls 2

FailureClass · 0.85
initializeFunction · 0.50

Tested by

no test coverage detected