Skip to contentSkip to conversation

socketpair - too many open files

DISCUSSION Jose González 1 participant 2 messages Jan 5, 2006 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hello.
I am programming an application that need to create over 300 threads. Each thread calls socketpair function, but it returns EMFILE when it is called 150 times. Which kernel parameter can I change to do it? Best regards,
Jose.

#2 lore raw
In reply to a message not in the archive
Quoted 14 lines · Alan Cox
Quoted 4 lines · Jose González

Hello.
I am programming an application that need to create over 300 threads. Each thread calls socketpair function, but it returns EMFILE when it is called 150 times. Which kernel parameter can I change to do it?

Its a user space matter. See "ulimit -a" and find out how your distribution sets the default limits

I modified this limit (open files, ulimit -n), even I have modified it in the kernel sources. I think that open file number isn't the problem. Is there a limit in the open sockets?