%% David Boyce <[EMAIL PROTECTED]> writes: db> I have something like this in my code. What I chose to do, rather db> than try to determine the max fd, was to pick a number north of (say) db> 50 and south of 256. I try to dup to that and then, if it fails, the db> next 10 values or so (or I guess you could go to 257 or 1025 if so db> inclined). If none of them works, I just drop back to using what the db> OS gave me. ISTM the odds of of this not working are very low and db> even if it doesn't you're no worse off.
True. db> Here's the relevant code (seeing it again for the first time in a db> while, I think the lseek is redundant). No, it's not. If the target FD is open then dup2() will unceremoniously close it before dup'ing it. Not good. -- ------------------------------------------------------------------------------- Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: http://www.gnu.org http://make.paulandlesley.org "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
