I was recently helping to debug a problem with an application getting
bad file descriptor errors when run from a shell wrapper script.  The
cause was that the parent process left fildes 255 open for the child
process, but the bash wrapper script was causing fildes 255 to be
closed.

  Looking at open_shell_script() in shell.c and move_to_high_fd() in
general.c, I find that the code will force the use of fildes 255,
(HIGH_FD_MAX), for reading the shell script when getdtablesize() reports
that the maximum allowed file descriptor value is greater than 255.
In this particular case the maximum file descriptor value was 1023,
which would have stayed out of the way of the application's use.

  Does HIGH_FD_MAX need to be so low?  (OK.  255 isn't _REALLY_ low.)
Are there negative consequences for using a higher file descriptor when
getdtablesize() reports that they are allowed?

-- 
Mike Stroyan, [EMAIL PROTECTED]


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to