Changeset 1366
- Timestamp:
- Apr 15, 2004, 12:50:33 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/filehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1365 r1366 22 22 * 23 23 */ 24 25 /******************************************************************************* 26 * Defined Constants And Macros * 27 *******************************************************************************/ 28 /** Maximum number of file handles. */ 29 #define __LIBC_MAX_FHS 10000 30 /** Number of file handles to increase the max value with. */ 31 #define __LIBC_INC_FHS 64 24 32 25 33 /******************************************************************************* … … 247 255 * How many handles? 248 256 * Now, we must be somewhat sensibel about incrementing this number 249 * into unreasonable values. If an application requires 10000+ files 250 * it must take steps to tell that to OS/2. If he has we'll receive 251 * cMin > 10000, else keep 10000 as a max limit for auto increase. 257 * into unreasonable values. If an application requires __LIBC_MAX_FHS+ 258 * files it must take steps to tell that to OS/2. If he has we'll receive 259 * cMin > __LIBC_MAX_FHS, else keep __LIBC_MAX_FHS as a max limit for 260 * auto increase. 252 261 */ 253 262 lDeltaFHs = 0; … … 260 269 if (cMin < cNewMaxFHs) 261 270 { /* auto increment. */ 262 cMin = cNewMaxFHs + 100;263 if (cMin > 10000 && gcFHs > 10000)271 cMin = cNewMaxFHs + __LIBC_INC_FHS; 272 if (cMin > __LIBC_MAX_FHS) 264 273 { 265 FS_RESTORE(); 266 return ERROR_TOO_MANY_OPEN_FILES; 274 if (gcFHs >= __LIBC_MAX_FHS) 275 { 276 FS_RESTORE(); 277 return ERROR_TOO_MANY_OPEN_FILES; 278 } 279 cMin = __LIBC_MAX_FHS; 267 280 } 268 281 } … … 281 294 if (!rc) 282 295 { 283 284 296 /* 285 297 * Reallocate the array of handle pointers. … … 327 339 } 328 340 341 342 /** 343 * Auto increase the MAX FH limit for this process. 344 * 345 * @returns 0 on success. 346 * @returns -1 on failure. 347 */ 348 int __libc_FHMoreHandles(void) 349 { 350 int rc; 351 if (_fmutex_request(&gmtx, 0)) 352 return -1; 353 354 rc = __libc_fhMoreHandles(0); 355 356 _fmutex_release(&gmtx); 357 return rc; 358 } 329 359 330 360 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.