www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/28/06:30:22

Date: Wed, 28 Feb 2001 13:28:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Stromberg <eplmst AT epl DOT ericsson DOT se>
cc: djgpp-workers AT delorie DOT com
Subject: Re: FD 4 special for DJGPP (and Perl in particular)?
In-Reply-To: <200102281109.MAA06814@lws256.lu.erisoft.se>
Message-ID: <Pine.SUN.3.91.1010228132133.18772D-100000@is>
MIME-Version: 1.0
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

On Wed, 28 Feb 101, Martin Stromberg wrote:

> > However, the
> >   exec 4>&1
> > causes the following error:
> > redirection error: Bad file descriptor (EBADF)
> > 
> > Only fd 4 seems to be affected.
> 
> Doesn't *DOZE have five predefined fds: stdin, stdout, stderr, AUX and
> PRN (not sure about the order of the last two).

It does; but so what?  A redirection such as above calls dup2(1, 4).
dup2 should close the previous handle 4, if it was open, before it 
redirects it to handle 1.

Anyway, if your theory is correct, the same proble, should happen with 
handle 3.  Does it?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019