Changeset 16370 in vbox for trunk/src/VBox/Main/xpcom/server.cpp
- Timestamp:
- Jan 29, 2009 2:49:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xpcom/server.cpp
r16267 r16370 61 61 #include <getopt.h> 62 62 63 #if def RT_OS_SOLARIS63 #ifndef RT_OS_OS2 64 64 # include <sys/resource.h> 65 65 #endif … … 1051 1051 do 1052 1052 { 1053 #ifdef RT_OS_SOLARIS1054 struct rlimit lim;1055 if (getrlimit(RLIMIT_NOFILE, &lim) == 0)1056 {1057 if (lim.rlim_cur < 2048)1058 {1059 lim.rlim_cur = 2048;1060 if (setrlimit(RLIMIT_NOFILE, &lim) != 0)1061 {1062 getrlimit(RLIMIT_NOFILE, &lim);1063 printf ("WARNING: failed to increase per-process file-descriptor limit to 2048.\n", lim.rlim_cur);1064 }1065 }1066 }1067 else1068 printf ("WARNING: failed to obtain per-process file-descriptor limit.\n");1069 #endif1070 1071 1053 rc = com::Initialize(); 1072 1054 if (NS_FAILED (rc)) … … 1186 1168 } 1187 1169 1170 #ifndef RT_OS_OS2 1171 struct rlimit lim; 1172 if (getrlimit(RLIMIT_NOFILE, &lim) == 0) 1173 { 1174 int k = 10240; 1175 for (; k >= 2048; k -= 1024) 1176 { 1177 if (lim.rlim_cur < k) 1178 { 1179 lim.rlim_cur = k; 1180 if (setrlimit(RLIMIT_NOFILE, &lim) == 0) 1181 break; 1182 } 1183 else 1184 break; 1185 } 1186 if (k <= 2048) 1187 printf("WARNING: failed to increase file descriptor limit.\n"); 1188 } 1189 else 1190 printf ("WARNING: failed to obtain per-process file-descriptor limit.\n"); 1191 #endif 1192 1188 1193 PLEvent *ev; 1189 1194 while (gKeepRunning)
Note:
See TracChangeset
for help on using the changeset viewer.