Let's say I have a makefile with a recipe called
hour_long_recipe
, which as its name suggests takes an hour to run. At random points throughout the recipe it asks yes/no questions. Let's say it asks 10 questions in total.
One possible (and often recommended) way to run it is:
yes | make hour_long_recipe
which answers all questions with y
. However, from my understanding, yes
keeps outputting to its stdout at [up to 10.2 GiB per second](https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/) regardless of whether make
is actually using that data from its stdin.
Even if it was just 10 MiB/s (much slower than any implementation of yes
if that reddit thread is to be believed), during the course of an hour it would add up to over 35 GiB, of which just 20 bytes will be read. Where does the data go? It's possible to save it to disk but that's wasteful, and if the disk fills up fast enough it can even cause make
to fail.
Presumably the operating system will stop it from getting to that, but how? What is the limit, and what happens when that limit is reached?
Asked by NeatNit
(291 rep)
Dec 31, 2020, 01:20 PM
Last activity: Jan 28, 2023, 11:06 AM
Last activity: Jan 28, 2023, 11:06 AM