home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_02 / 2n02055a < prev    next >
Text File  |  1991-01-02  |  2KB  |  47 lines

  1.  
  2. /* ---------------------------------------------------
  3.     TESTSFHT.C  -  Microsoft C ver 5.1
  4.  
  5.     A driver used to validate the assembly language
  6.     functions max_sys_file_handles() and
  7.     sys_handles_in_use().
  8.  
  9.     From the command line, executing this program
  10.     will print the following line.
  11.          Total system handles available: [n]
  12.          System handles in use: [i]
  13.     where n is the number of file handles specified
  14.     in the CONFIG.SYS FILES=n directive and i is the
  15.     number of system file information blocks which are
  16.     active.  If no CONFIG.SYS file was found at boot
  17.     time, or there was no FILES=n statement, or the
  18.     FILES=n statement had n < 8, n will equal 8.  If
  19.     run from the DOS command line without redirection,
  20.     i will equal 3.  Output redirected to a file will
  21.     increase i by 1.
  22.  
  23.     Test the driver with varying values n in the
  24.     CONFIG.SYS FILES=n statement.  Remember to reboot
  25.     after changing the CONFIG.SYS.
  26.  
  27.     Commands to produce an executable from the code as
  28.     shown in the listings:
  29.         masm sfht;             (listing 1)
  30.         cl -c testsfht.c       (listing 2)
  31.         link testsfht sfht;
  32.   -------------------------------------------------- */
  33.  
  34. #include <stdio.h>
  35.  
  36. extern int max_sys_file_handles(void);
  37. extern int sys_handles_in_use(void);
  38.  
  39. main()
  40. {
  41.   printf("Total system handles available: [%d]\n",
  42.           max_sys_file_handles());
  43.   printf("System handles in use: [%d]\n",
  44.           sys_handles_in_use() );
  45. }
  46.  
  47.