3 ms·
There's one unfortunate historical reason: passing FDs >=1024 to glibc's "select" function doesn't work, so it would be a breaking change to ever raise the defa
by josephcsible 1y ago
There's one unfortunate historical reason: passing FDs >=1024 to glibc's "select" function doesn't work, so it would be a breaking change to ever raise the default soft limit above that. It's perfectly fine for the default hard limit to be way higher, though, and for programs that don't use "select" (or that use the kernel syscall directly, but you should really just use poll or epoll instead) to raise their own soft limit to the hard limit.
- Borg3 1y agoWell, if you want more, you can just set it via: #define FD_SETSIZE <value> Just keep value sane ;) 4096 or 5120 should be okish.
- josephcsible 1y agoFD_SETSIZE isn't something you can just redefine like that. You'd have to reimplement all the types, macros, etc. yourself.
- quotemstr 1y agoYes, it is in fact something you can just redefine yourself. That's not to say you should do it.
- josephcsible 1y agoRight. You can but generally shouldn't. Like I said upthread, you're better off using poll or epoll.