MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / receive_io

Function receive_io

modules/data/mp3/libmad/decoder.c:150–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150static
151enum mad_flow receive_io(int fd, void *buffer, size_t len)
152{
153 char *ptr = buffer;
154 ssize_t count;
155
156 while (len) {
157 do
158 count = read(fd, ptr, len);
159 while (count == -1 && errno == EINTR);
160
161 if (count == -1)
162 return (errno == EAGAIN) ? MAD_FLOW_IGNORE : MAD_FLOW_BREAK;
163 else if (count == 0)
164 return MAD_FLOW_STOP;
165
166 len -= count;
167 ptr += count;
168 }
169
170 return MAD_FLOW_CONTINUE;
171}
172
173static
174enum mad_flow receive_io_blocking(int fd, void *buffer, size_t len)

Callers 2

receive_io_blockingFunction · 0.85
receiveFunction · 0.85

Calls 1

readFunction · 0.50

Tested by

no test coverage detected