home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / sps / part1 / filecount.c next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  351 b   |  17 lines

  1. # include       "sps.h"
  2.  
  3. /* FILECOUNT - Counts the # open files for the current process */
  4. filecount ()
  5. {
  6.     register int            i ;
  7.     register struct file    **f ;
  8.     register int            count ;
  9.     extern union userstate  User ;
  10.  
  11.     count = 0 ;
  12.     for ( i = 0, f = User.u_us.u_ofile ; i < NOFILE ; i++ )
  13.         if ( *f++ )
  14.             count++ ;
  15.     return ( count ) ;
  16. }
  17.