MCPcopy Create free account
hub / github.com/ElementsProject/lightning / my_read

Function my_read

connectd/test/run-websocket.c:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17static size_t my_rbuf_off;
18
19static ssize_t my_read(int fd, void *buf, size_t count)
20{
21 if (strlen(my_rbuf + my_rbuf_off) < count)
22 count = strlen(my_rbuf + my_rbuf_off);
23 memcpy(buf, my_rbuf + my_rbuf_off, count);
24 my_rbuf_off += count;
25 return count;
26}
27static bool my_read_all(int fd, void *buf, size_t count)
28{
29 my_read(fd, buf, count);

Callers 1

my_read_allFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected