Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!iuvax!pur-ee!a.cs.uiuc.edu!bradley!brian From: brian@bradley.UUCP Newsgroups: comp.lang.c Subject: Re: No fork() in MSC5.0, help... Message-ID: <9900006@bradley> Date: 21 Jul 88 15:50:00 GMT References: <9900005@bradley> Lines: 19 Nf-ID: #R:bradley:9900005:bradley:9900006:000:779 Nf-From: bradley.UUCP!brian Jul 21 10:50:00 1988 My thanks to everyone who responded to my question on doing I/O redirection for a child process without disturbing the parent processes I/O under Microsoft C 5.0. Apparently the only way to do it is by using dup() to copy stdin/stdout/stderr before starting the child process, and dup2() to restore them afterwards. The only drawback is that Microsoft C already reserves 5 fildes. If I dup() three, that only leaves 12 for the child process... ............................................................................... When the going gets weird, the weird turn pro. Brian Michael Wendt UUCP: {cepu,ihnp4,uiucdcs,noao}!bradley!brian Bradley University ARPA: cepu!bradley!brian@seas.ucla.edu (309) 677-2230 ICBM: 40 40' N 89 34' W