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

Function alloc_ibuf

src/dd.c:673–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671/* Ensure input buffer IBUF is allocated. */
672
673static void
674alloc_ibuf (void)
675{
676 if (ibuf)
677 return;
678
679 bool extra_byte_for_swab = !!(conversions_mask & C_SWAB);
680 ibuf = alignalloc (page_size, input_blocksize + extra_byte_for_swab);
681 if (!ibuf)
682 {
683 char hbuf[LONGEST_HUMAN_READABLE + 1];
684 error (EXIT_FAILURE, 0,
685 _("memory exhausted by input buffer of size %td bytes (%s)"),
686 input_blocksize,
687 human_readable (input_blocksize, hbuf,
688 human_opts | human_base_1024, 1, 1));
689 }
690}
691
692/* Ensure output buffer OBUF is allocated/initialized. */
693

Callers 3

alloc_obufFunction · 0.85
skipFunction · 0.85
dd_copyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected