Changeset 1361
- Timestamp:
- Apr 14, 2004, 10:01:47 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/testcase/1023-maxfilehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1360 r1361 29 29 int main(int argc, const char **argv) 30 30 { 31 int i ;31 int i,j; 32 32 LONG lFHDelta = 0; 33 33 ULONG cFHs = 0; 34 34 ULONG cFHLast; 35 35 unsigned msLastInc; 36 unsigned msEnd; 37 unsigned msStart; 36 38 PGINFOSEG pGIS = GETGINFOSEG(); 37 #define MAX_FHS 3276839 #define MAX_FHS 0x11000 38 40 static FILE *apFiles[MAX_FHS]; 39 41 … … 45 47 for (i = 0; i < MAX_FHS; i++) 46 48 { 47 unsigned msEnd; 48 unsigned msStart = pGIS->msecs; 49 apFiles[i] = fopen("\\dev\\nul", "rb"); 49 msStart = pGIS->msecs; 50 apFiles[i] = fopen(argv[argc - 1], "rb"); 50 51 msEnd = pGIS->msecs; 51 52 if (apFiles[i] == NULL) … … 61 62 if (cFHs != cFHLast) 62 63 { 63 printf("Max FH change %i : %d -> %d (inc: %d ms since last: %d ms)\n", i + 1, cFHLast, cFHs,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, 64 65 msEnd - msStart, msStart - msLastInc); 65 66 msLastInc = msEnd; … … 71 72 DosSetRelMaxFH(&lFHDelta, &cFHs); 72 73 printf("cFHs=%d\n", cFHs); 74 75 /* 76 * Free the files. 77 */ 78 msStart = pGIS->msecs; 79 for (j = 0; j < i; j++) 80 fclose(apFiles[j]); 81 msEnd = pGIS->msecs; 82 printf("close of %j files took %d ms\n", j, msEnd - msStart); 83 84 /* 85 * Report the result. 86 */ 73 87 if (i < 9900) 74 88 { -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.