On 5/13/16 2:40 PM, Mike Frysinger wrote: > i was pointed at a bug report for FreeBSD systems [1] where running lots > of processes in parallel would randomly fail with errors like: > cannot make pipe for process substitution: File exists > > upstream FreeBSD addressed this by defining USE_MKTEMP [2] & USE_MKSTEMP > [3] when building bash. looking at the source in bash though, i can't > see why these aren't always defined. why does bash try to reimplement > both funcs ad-hoc instead of just using the stable/guaranteed system > versions ?
Because many traditional implementations of mktemp/mkstemp suck.
> the bash versions seem like it's pretty trivial to collide: it mixes
> current seconds count, current pid number, and a counter.
Not quite; the calls in bash mix in the return value from the system's
random(). Now, if that sucks too, you're going to lose.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
signature.asc
Description: OpenPGP digital signature
