2005-06-29 Stepan Kasal * doc/autoconf.texi (File Descriptors): ksh doesn't pass open file descriptors to child processes; reported by Norman Gray. Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.919 diff -u -r1.919 autoconf.texi --- doc/autoconf.texi 28 Jun 2005 13:08:29 -0000 1.919 +++ doc/autoconf.texi 29 Jun 2005 10:34:42 -0000 @@ -10021,6 +10021,32 @@ Don't try to move/delete open files, such as in @samp{exec >foo; mv foo bar}; see @ref{Limitations of Builtins}, @command{mv} for more details. +Don't rely on open file descriptors being open in child processes. In address@hidden, file descriptors above 2 which are opened using address@hidden n>file} are closed by a subsequent @samp{exec} (such as +that involved in the fork-and-exec which runs a program or script). +Thus, using sh, we have: address@hidden +$ cat ./descrips +#! /bin/sh - +echo hello >&5 +$ exec 5>t +$ ./descrips +$ cat t +hello +$ address@hidden example +But using ksh: address@hidden +$ exec 5>t +$ ./descrips +hello +$ cat t +$ address@hidden example +Within the process which runs the @samp{descrips} script, file +descriptor number 5 is closed. + @node File System Conventions @section File System Conventions @cindex File system conventions @@ -13048,7 +13074,7 @@ cp bar.x bar.y cp: cannot stat `bar.x': No such file or directory *** Error code 1 -% @kbd{tmake} # True64 make +% @kbd{tmake} # Tru64 make cp ../bar.x bar.y @end example