top | item 42295308

(no title)

aumerle | 1 year ago

It's not even slightly tricky, just use self pipe. I have no idea why the maintainer of make rejected it. He says select has different signatures, but select is in POSIX, so unless he is porting to a non POSIX platform, it's irrelevant and even if he is, I doubt it is that hard to write a wrapper to abstract the non POSIX compatible implementation of select. Then he complains about needing to do CLOEXEC on the self pipe. This is trivial (one line) on Linux using pipe2 and about 5 lines of code on other platforms. Given that he says make does not use threads its also perfectly robust without pipe2.

Opting for a harder algorithm just to avoid a few lines of compatibility shims seems like very much the wrong tradeoff.

discuss

order

gpderetta|1 year ago

> so unless he is porting to a non POSIX platform

Very likely gmake works on non-posix platforms. Whether there is a requirement that the jobserver also works there I don't know.

It also needs to work on non-linux platforms. So a portable solution (or multiple non-portable ones) is needed.

aumerle|1 year ago

Yes, but this is two well known and understood functions we are talking about, wrapping them is really not that hard.