home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / sysconf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  665 b   |  28 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <errno.h>
  3. #include <unistd.h>
  4. #include <limits.h>
  5. #include <time.h>
  6.  
  7. long
  8. sysconf(int name)
  9. {
  10.   switch (name)
  11.   {
  12.   case _SC_ARG_MAX:    return ARG_MAX;
  13.   case _SC_CHILD_MAX:    return CHILD_MAX;
  14.   case _SC_CLK_TCK:    return CLOCKS_PER_SEC;
  15.   case _SC_NGROUPS_MAX:    return NGROUPS_MAX;
  16.   case _SC_OPEN_MAX:    return 255;
  17.   case _SC_JOB_CONTROL:    return -1;
  18.   case _SC_SAVED_IDS:    return -1;
  19.   case _SC_STREAM_MAX:    return _POSIX_STREAM_MAX;
  20.   case _SC_TZNAME_MAX:    return TZNAME_MAX;
  21.   case _SC_VERSION:    return _POSIX_VERSION;
  22.  
  23.   default:
  24.     errno = EINVAL;
  25.     return -1;
  26.   }
  27. }
  28.