httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert S. Thau" <...@ai.mit.edu>
Subject Re: getting that stupid solaris bug fixed
Date Thu, 19 Sep 1996 15:27:49 GMT
  He needs examples of
  commercial OSes which don't have this bug.

The root cause of the bug is that the FILE structure uses an unsigned
char to store the descriptor.  A quick check of the systems here shows
that Digital Unix uses a short, which is good up to 32K descriptors per
process; HP-UX uses a weird structure which has separate 'char' members
for the low byte and the high byte of the descriptor; it, too, could
accomodate at least 32K of 'em, at least to judge by the data structure.
(I haven't actually written a program which opens more than 256 FILE*'s,
and verified that they're all distinct and they all work, but given 
these layouts, you'd have to work very hard to break it).

SGI has an #ifdef in its stdio.h --- it's broken in 32-bit mode, but
uses an 'int' in 64-bit mode.

(NB I said 32K descriptors per process and not 64K, because it is easy
to lose half the available descriptor space by treating the descriptors
as signed --- which sunos does, limiting its stdio to the low 128 possible
descriptors).

rst

Mime
View raw message