%% "Philip Guenther" <[EMAIL PROTECTED]> writes: db> Here's the relevant code (seeing it again for the first time in a db> while, I think the lseek is redundant).
pg> On 7/30/06, Paul D. Smith <[EMAIL PROTECTED]> wrote: >> No, it's not. If the target FD is open then dup2() will unceremoniously >> close it before dup'ing it. pg> ...which is why fcntl(fd, F_DUPFD, min_fd) exists. I'm not sure pg> when that fnctl() command was first standardized, but I see it in pg> the SUSv2 spec... Correct, fcntl() is the "approved" way to do this now. However, as you allude to, it's not nearly as portable as dup2(), even if it is in SUSv2. For a program like GNU make I'll stick with dup2() I think. -- ------------------------------------------------------------------------------- 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
