This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Increasing FD_SETSIZE


On 10/05/2012 05:55 PM, Marco Stornelli wrote:

after a search I understood the trick. FD_SIZE, FD_ZERO and so on are
macro and not function (your application won't call an external
library), so if you change __FD_SETSIZE you are changing the size of
fd_set and when you compile your application everything it's ok. Glibc
uses poll when needed so no problem. From kernel point of view there is
no problem because it uses the first paramenter of select and then the
max fds per-process, there isn't a problem to handle a bigger struct
fd_set. So at the end, in your development environment you need to
change .h and in your target environment you need to do uname -n 4096. A
problem can happen I think, if in this condition, you try to run your
application on a system with uname -n 1024.

From the glibc side, it will work, but if there's other library code which uses select for I/O multiplexing (parts of Qt, for example), you'll have to make sure that there's enough room in the sub-1024 descriptor space (fcntl(F_DUPFD) is good for this task, older Squid versions should contain example code).


--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]