home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / pathconf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-01  |  657 b   |  26 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.  
  6. long
  7. pathconf(const char *path, int name)
  8. {
  9.   switch (name)
  10.   {
  11.   case _PC_LINK_MAX:        return LINK_MAX;
  12.   case _PC_MAX_CANON:        return MAX_CANON;
  13.   case _PC_MAX_INPUT:        return MAX_INPUT;
  14.   case _PC_NAME_MAX:        return NAME_MAX;
  15.   case _PC_PATH_MAX:        return PATH_MAX;
  16.   case _PC_PIPE_BUF:        return PIPE_BUF;
  17.   case _PC_CHOWN_RESTRICTED:    return _POSIX_CHOWN_RESTRICTED;
  18.   case _PC_NO_TRUNC:        return _POSIX_NO_TRUNC;
  19.   case _PC_VDISABLE:        return _POSIX_VDISABLE;
  20.  
  21.   default:
  22.     errno = EINVAL;
  23.     return -1;
  24.   }
  25. }
  26.