From: Nigel Stephens Date: Fri, 26 Aug 94 18:24:43 +0100 To: eliz AT is DOT elta DOT co DOT il Cc: Nigel Stephens , Victor Essers , djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: help References: <8855 DOT 9408261234 AT moorgate DOT algor DOT co DOT uk> <9408261443 DOT AA12414 AT is DOT elta DOT co DOT il> eliz AT is DOT elta DOT co DOT il (eliz AT is DOT elta DOT co DOT il) writes: > > Speaking of which, I have seen very strange behaviour in a GO32 > > program, where open() succeeds and returns file descriptor 20, but > > calling read() with this descriptor returns errno==EBADF! > > Do you have a short program which shows this behavior? Under what > version of DJGPP this happens? DJGPP 1.12. Unfortunately the program is not small, it is the binutils-2.4 version of ld! In this case it is a cross-linker, rather than DJGPP native, but I imagine that the same would happen with the DJ linker. The bfd library maintains a cache of up to 10 open object files. When go32 is using more than its normal number of open files (i.e. it has emu387 and/or gdb mapped in), then the 10th open trips over this limit (the first open under gdb does return 10). I solved the problem by reducing bfd's open file cache limit. _________________________________________________________________________ Nigel Stephens, Algorithmics Ltd, 3 Drayton Park, London, N5 1NU, England phone: +44 71 700 3301 fax: +44 71 700 3400 email: nigel AT algor DOT co DOT uk