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

Function receive_io_blocking

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

Source from the content-addressed store, hash-verified

171}
172
173static
174enum mad_flow receive_io_blocking(int fd, void *buffer, size_t len)
175{
176 int flags, blocking;
177 enum mad_flow result;
178
179 flags = fcntl(fd, F_GETFL);
180 if (flags == -1)
181 return MAD_FLOW_BREAK;
182
183 blocking = flags & ~O_NONBLOCK;
184
185 if (blocking != flags &&
186 fcntl(fd, F_SETFL, blocking) == -1)
187 return MAD_FLOW_BREAK;
188
189 result = receive_io(fd, buffer, len);
190
191 if (flags != blocking &&
192 fcntl(fd, F_SETFL, flags) == -1)
193 return MAD_FLOW_BREAK;
194
195 return result;
196}
197
198static
199enum mad_flow send(int fd, void const *message, unsigned int size)

Callers 1

receiveFunction · 0.85

Calls 1

receive_ioFunction · 0.85

Tested by

no test coverage detected