Changeset 1362 for trunk/testcase/1023-maxfilehandles.c
- Timestamp:
- Apr 15, 2004, 12:17:42 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/testcase/1023-maxfilehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1361 r1362 23 23 #endif 24 24 #include <stdio.h> 25 #include <io.h> 26 #include <fcntl.h> 25 27 #include <string.h> 26 28 … … 37 39 unsigned msStart; 38 40 PGINFOSEG pGIS = GETGINFOSEG(); 39 #define MAX_FHS 0x11000 41 #define MAX_FHS 10000 42 #ifdef TEST_STREAMS 40 43 static FILE *apFiles[MAX_FHS]; 44 #else 45 static int aiFiles[MAX_FHS]; 46 #endif 41 47 42 48 DosSetRelMaxFH(&lFHDelta, &cFHs); … … 48 54 { 49 55 msStart = pGIS->msecs; 56 #ifdef TEST_STREAMS 50 57 apFiles[i] = fopen(argv[argc - 1], "rb"); 58 #else 59 aiFiles[i] = open(argv[argc - 1], O_BINARY | O_RDONLY); 60 #endif 51 61 msEnd = pGIS->msecs; 62 #ifdef TEST_STREAMS 52 63 if (apFiles[i] == NULL) 64 #else 65 if (aiFiles[i] < 0) 66 #endif 53 67 { 54 68 printf("error %d!\n", i + 1); … … 62 76 if (cFHs != cFHLast) 63 77 { 64 printf("Max FH change %i (fh=%d): %d -> %d (inc: %d ms since last: %d ms)\n", i + 1, fileno(apFiles[i]), cFHLast, cFHs, 78 printf("Max FH change %i (fh=%d): %d -> %d (inc: %d ms since last: %d ms)\n", 79 i + 1, 80 #ifdef TEST_STREAMS 81 fileno(apFiles[i]), 82 #else 83 aiFiles[i], 84 #endif 85 cFHLast, cFHs, 65 86 msEnd - msStart, msStart - msLastInc); 66 87 msLastInc = msEnd; … … 78 99 msStart = pGIS->msecs; 79 100 for (j = 0; j < i; j++) 101 #ifdef TEST_STREAMS 80 102 fclose(apFiles[j]); 103 #else 104 close(aiFiles[j]); 105 #endif 81 106 msEnd = pGIS->msecs; 82 printf("close of % jfiles took %d ms\n", j, msEnd - msStart);107 printf("close of %d files took %d ms\n", j, msEnd - msStart); 83 108 84 109 /* -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.