home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / comm / amitcp-sdk-4.0.lha / AmiTCP-SDK / src / rpclib / rpc_dtablesize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-30  |  723 b   |  33 lines

  1. /*
  2.  *      $Id: rpc_dtablesize.c,v 4.2 1994/09/29 23:48:50 jraja Exp $
  3.  *
  4.  *      RPC getdtablesize() cache.
  5.  *      
  6.  *      Copyright © 1994 AmiTCP/IP Group,
  7.  *                       Network Solutions Development Inc.
  8.  *                       All rights reserved. 
  9.  */
  10.  
  11. /* @(#)rpc_dtablesize.c    2.1 88/07/29 4.0 RPCSRC */
  12. #if !defined(lint) && defined(SCCSIDS)
  13. static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
  14. #endif
  15.  
  16. #include <sys/param.h>
  17. #include <sys/socket.h>
  18.  
  19. /*
  20.  * Cache the result of getdtablesize(), so we don't have to do an
  21.  * expensive system call every time.
  22.  */
  23. int 
  24. _rpc_dtablesize(void)
  25. {
  26.     static int size;
  27.     
  28.     if (size == 0) {
  29.         size = getdtablesize();
  30.     }
  31.     return (size);
  32. }
  33.