MCPcopy Create free account
hub / github.com/coreutils/coreutils / read_input

Function read_input

src/csplit.c:256–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254 Return the number of bytes read. */
255
256static idx_t
257read_input (char *dest, idx_t max_n_bytes)
258{
259 if (max_n_bytes == 0)
260 return 0;
261
262 ptrdiff_t bytes_read = safe_read (STDIN_FILENO, dest, max_n_bytes);
263
264 if (bytes_read == 0)
265 have_read_eof = true;
266
267 if (bytes_read < 0)
268 {
269 error (0, errno, _("read error"));
270 cleanup_fatal ();
271 }
272
273 return bytes_read;
274}
275
276/* Initialize existing line record P. */
277

Callers 1

load_bufferFunction · 0.70

Calls 1

cleanup_fatalFunction · 0.85

Tested by

no test coverage detected