MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / transfer

Function transfer

tests/test_coverage_children.c:62–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60} Child;
61
62static bool transfer(int fd, char *value, bool writing) {
63 struct pollfd pollfd = {.fd = fd, .events = writing ? POLLOUT : POLLIN};
64 int ready;
65 do {
66 ready = poll(&pollfd, 1, 60000);
67 } while (ready < 0 && errno == EINTR);
68 if (ready <= 0)
69 return false;
70 ssize_t count;
71 do {
72 count = writing ? write(fd, value, 1) : read(fd, value, 1);
73 } while (count < 0 && errno == EINTR);
74 return count == 1;
75}
76
77static bool send_byte(int fd, char value) {
78 return transfer(fd, &value, true);

Callers 2

send_byteFunction · 0.70
expect_byteFunction · 0.70

Calls 3

readFunction · 0.70
pollFunction · 0.50
writeFunction · 0.50

Tested by

no test coverage detected