Changeset 16370 in vbox for trunk/src/libs/xpcom18a4/ipc/ipcd/daemon
- Timestamp:
- Jan 29, 2009 2:49:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcdUnix.cpp
r16267 r16370 45 45 #include <string.h> 46 46 47 #ifdef RT_OS_ SOLARIS47 #ifdef RT_OS_OS2 48 48 # include <sys/resource.h> 49 49 #endif … … 397 397 PRFileDesc *clientFD; 398 398 399 // @todo : We need to handle errors from accept() especially something like 400 // EMFILE, which happens when we run out of file descriptors. 401 // and puts XPCOMIPCD in a poll/accept endless loop! 399 402 clientFD = PR_Accept(listenFD, &clientAddr, PR_INTERVAL_NO_WAIT); 400 403 if (clientFD == NULL) { … … 478 481 PL_strncpyz(addr.local.path, argv[1], sizeof(addr.local.path)); 479 482 480 #ifdef RT_OS_SOLARIS481 struct rlimit lim;482 if (getrlimit(RLIMIT_NOFILE, &lim) == 0)483 {484 if (lim.rlim_cur < 2048)485 {486 lim.rlim_cur = 2048;487 if (setrlimit(RLIMIT_NOFILE, &lim) != 0)488 {489 getrlimit(RLIMIT_NOFILE, &lim);490 printf ("WARNING: failed to increase per-process file-descriptor limit to 2048\n", lim.rlim_cur);491 }492 }493 }494 else495 printf ("WARNING: failed to obtain per-process file-descriptor limit.\n");496 #endif497 498 483 #ifdef IPC_USE_FILE_LOCK 499 484 Status status = InitDaemonDir(addr.local.path); … … 544 529 IPC_NotifyParent(); 545 530 531 #if defined(VBOX) && !defined(XP_OS2) 532 struct rlimit lim; 533 if (getrlimit(RLIMIT_NOFILE, &lim) == 0) 534 { 535 int k = 10240; 536 for (; k >= 2048; k -= 1024) 537 { 538 if (lim.rlim_cur < k) 539 { 540 lim.rlim_cur = k; 541 if (setrlimit(RLIMIT_NOFILE, &lim) == 0) 542 break; 543 } 544 else 545 break; 546 } 547 if (k <= 2048) 548 printf("WARNING: failed to increase file descriptor limit.\n"); 549 } 550 else 551 printf ("WARNING: failed to obtain per-process file-descriptor limit.\n"); 552 #endif 553 546 554 PollLoop(listenFD); 547 555 }
Note:
See TracChangeset
for help on using the changeset viewer.