It is a limitation of FILE *, and probably some C library functions under
solaris. But FILE * is the largest problem with it. Sun has never said
they would fix it... because fixing it breaks binary compatibility.
We've proposed a bunch of fixes. Including the obvious: don't use stdio.
You could try linking against sfio in stdio compatibility mode. If that's
not an option you're kind of stuck. But you could add this to util.c:
int get_high_fd (int fd)
{
int high_fd;
if (fd >= 256) {
return fd;
}
high_fd = fcntl (fd, F_DUPFD, 256);
if (high_fd == -1) {
return fd;
}
close (fd);
return high_fd;
}
And then after every socket(), and open() call (which aren't fdopen()d later)
just go fd = get_high_fd (fd);.
That'll leave the arena < 256 available for fopens.
Dean
On Fri, 25 Apr 1997, Brian Tao wrote:
> I'm bumping into what appears to be a limit of 255 open files
> under Solaris 2.5.1.
|