Message-Id: <4.3.1.0.20001028153622.00b18a90@pop5.banet.net> X-Sender: usbanet DOT farley3 AT pop5 DOT banet DOT net X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Sat, 28 Oct 2000 15:53:11 -0400 To: djgpp-workers AT delorie DOT com From: "Peter J. Farley III" Subject: Re: Bash 2.04 beta 6a Cc: Eli Zaretskii In-Reply-To: <9003-Sat28Oct2000092528+0200-eliz@is.elta.co.il> References: <4 DOT 3 DOT 1 DOT 0 DOT 20001027192402 DOT 00b199b0 AT pop5 DOT banet DOT net> <200010270805 DOT KAA00023 AT lws256 DOT lu DOT erisoft DOT se> <200010270805 DOT KAA00023 AT lws256 DOT lu DOT erisoft DOT se> <4 DOT 3 DOT 1 DOT 0 DOT 20001027192402 DOT 00b199b0 AT pop5 DOT banet DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk At 09:25 AM 10/28/00 +0200, Eli Zaretskii wrote: >Note that popen/pclose from our libc also redirect handles with >dup/dup2 and call system() to run the subsidiary program. I guess Laszlo put those in before the current popen/pclose were available. Better, I think, if we try to use what's in libc, so that future changes aren't lost to perl. I'll try removing his perl-specific versions and make sure everything still works. If it turns out we need to use "exec("sh -c 'command...'")" or "spawn...("sh -c 'command...'")" to duplicate *ix behavior, then I can put the special versions into perl only, leaving libc alone. >> So DJGPP perl is using strictly system(), and now I need to >> find out what perl uses elsewhere. And maybe what a *ix popen/pclose >> really use. > >I'd expect a Unix system to do this inside popen: > > call pipe() to open a pipe > call fork() to start the child program > in the child-program's branch of fork, call exec("sh -c > 'command-line'") > in the parent-program's branch, read and write the pipe > when wait() says the child exited, close the pipes and cleanup Well, glibc "iopopen.c" seems to do pretty much exactly that, anyway. Is there any way (at present) to override system()'s use of "bash tmpfile" or "sh tmpfile", say if the command line is short enough to stay within DOS commandline limits? What about just for power users who have set up CONFIG.SYS to use the "command.com" switch "/u:255"? I'd bet there is a way to determine if that was done *somewhere* in the DOS internals. Just speculating here. I still have not determined just exactly how perl implements open(fh, "echo #foo|"), so we are still lacking critical information needed to determine a path to take. More as I get it. --------------------------------------------------------- Peter J. Farley III (pjfarley AT dorsai DOT org OR pjfarley AT banet DOT net)