summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 9e2db60..350fae6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/resource.h>
#include <fcntl.h>
#include <getopt.h>
#include <pwd.h>
@@ -525,6 +526,12 @@ int main(int argc, char *argv[])
goto terminate;
}
+ // set number of file descriptors to higher value
+ struct rlimit rlim;
+ getrlimit(RLIMIT_NOFILE, &rlim);
+ rlim.rlim_max = 65536;
+ setrlimit(RLIMIT_NOFILE, (const struct rlimit*)&rlim);
+
usbmuxd_log(LL_INFO, "Creating socket");
res = listenfd = create_socket();
if(listenfd < 0)