bug-make
[Top][All Lists]
Advanced

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

[bug #52922] -Otarget does not function properly and errors on FreeBSD,


From: John Hood
Subject: [bug #52922] -Otarget does not function properly and errors on FreeBSD, with stdout to a pipe
Date: Fri, 19 Jan 2018 17:01:14 -0500 (EST)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0

Follow-up Comment #2, bug #52922 (project make):

I spent a while longer looking at this, and being reminded of how messy UNIX
locking is.

* On FreeBSD, none of fcntl-locks, flock(), and lockf() work on pipes.

* POSIX reminds me that write() is atomic on regular files.  If make were to
carefully accumulate and concatenate output for stdout and stderr into
buffers, and then write() entire buffers, make might not need locking at all
for regular files.  Of course, buffers of unbounded size would be a problem
here.

* Network file systems have varying support for locking.

I think having either a lock file or a POSIX semaphore to share with children
is probably the best way to handle this.  This loses the
redirected-children-dont-lock property, but in output_dump() make is pretty
much just copying the temporary output and doing fairly simple sprintfs for
its own output.  That should go fairly fast most of the time, and I'd guess
concurrency wouldn't be a major problem, except for really pathological cases
such as very large numbers of targets or very large output from targets.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52922>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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