Source-Changes archive

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

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   rillig
Date:           Wed Apr 23 19:27:23 UTC 2025

Modified Files:
        src/usr.bin/make: job.c

Log Message:
make: prevent overly large values for the -j option

A comment previously suggested to clip the number of parallel jobs to
PIPE_BUF, but that would have been wrong, as PIPE_BUF is not the maximum
capacity of a pipe, but rather the maximum number of bytes that are
guaranteed to be written to the pipe atomically.

Previously, the output end of the token pool pipe was blocking, which
meant that the "errno == EAGAIN" branches were unreachable. Now that the
pipe is nonblocking, they would be reachable. When setting up the token
pool, writing to a full pipe indicates too many parallel jobs requested,
and is thus rejected. At any later point in time, writing to a full pipe
indicates an internal error, as each sub-make is supposed to only return
as many tokens as it previously took from the pool. Therefore, error out
in these situations.


To generate a diff of this commit:
cvs rdiff -u -r1.496 -r1.497 src/usr.bin/make/job.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index