lkml.org 
[lkml]   [1997]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: How to increat [sic.] max open files - some answers
Date
Hello, world!

> The problem is, instead, with the auxilliary support functions, in
> particular with the definition of fd_set. Unlike, for example, FILE,
> which is only user-visible as a pointer, so that tons of programs
> won't have a preconcieved notion of the size of the object, in the
> stardard API the user program handles allocation of fd_set's, and has
> to know the size. This is where BSD blew it, and blew it big time.
>
> Since it is standard practice for programs to do things like:
>
> fd_set fooset;
> int fd;
>
> fd = open(...);
> FD_SET(fd, &fooset);
>
> ... if open() can return a descriptor larger than the size of the set,
> you're dead.
>
> If you can require recoding of programs, the problem becomes easy:
> just make FD_ZERO() allocate dynamic data and require a new function
> FD_FREE() to free it up. Unfortunately, acceptance is not likely to
> be that great.

The current size of fd_set is more than sufficient for most programs,
but there are some exceptions (irc servers etc.) which require much more.
I think it won't make much harm when we leave the fd_set as it is and
add some more functions for creation of fd_set with _given_ size and
then modify the few affected programs to use that.

Martin


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.057 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site