From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen) Subject: Error in dup??? 13 Nov 1998 18:23:26 -0800 Message-ID: <364CE31A.71A3E6F0.cygnus.cygwin32.developers@cityweb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: cygwin32-developers AT cygnus DOT com Hello! Interesting effect: tcsh does a lot of dup()-calls. The following code in tcsh: ... close(0); (void) dup(foo_fd); ... doesn't create fd == 0 but something like 55 or else. This only happens, if tcsh is a subshell. If tcsh is the login shell, anything works. And, for test purposes, I have substituted the above code by: ... close(0); (void) dup2(foo_fd, 0); ... and it did it as expected! The new fd is 0 in subshells, too. It happens in tty and notty mode. Seems to be a problem in dup(). Any idea? Corinna