[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"make" puts stdout into append mode?

From: Paul Eggert
Subject: "make" puts stdout into append mode?
Date: Tue, 27 Dec 2016 11:59:56 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

I'm following up to this bug report for 'grep'


Although this was a grep bug (grep mishandles /dev/null output when stdout is in append mode), it seems to me that GNU make helped trigger the bug. GNU make puts stdout and stderr into append mode, which is surprising. This is presumably to avoid losing output when running in parallel mode. Still:

1. Can't multiple make processes write reliably to a single file even when the file descriptor is not in append mode? They share the same file description, after all. So I don't see why append mode is helpful here. Perhaps it works around bugs in some operating systems?

2. I suggest that stdout and stderr be put into append mode only when GNU make is running parallel jobs. This should lessen the likelihood of glitches like this in the future, and should not cause any problem with output from multiple make processes. Arguably GNU make's current behavior in this area does not conform to POSIX, and this suggestion should fix the conformance issue since (as I understand it) 'make' runs in parallel only when not conforming to POSIX.

3. Assuming 'make' uses O_APPEND for good reason, its behavior in this area should be documented in the manual.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]