pdesr/slurm — comment on commit 9ff604a8c5c4e15659f878c7e1a6f18028515977
File: src/common/env.c line 1631
By grondo:

You would use cbuf_write_from_fd (), which writes into the circular buffer, which grows as needed.

Then you could either use cbuf_peek() to seek to the next NUL character, or you could copy the data
out to a char *buffer using

buf = xmalloc (cbuf_used (cb));
cbuf_read (cb, buf, cbuf_used (cb));

However, since this requires copying all the data, maybe you're right and it is not worth it at this point.