1 /* POSIX fpathconf (Sec. 5.7.1) Author: Andy Tanenbaum */
13 long fpathconf(fd
, name
)
14 int fd
; /* file descriptor being interrogated */
15 int name
; /* property being inspected */
17 /* POSIX allows some of the values in <limits.h> to be increased at
18 * run time. The pathconf and fpathconf functions allow these values
19 * to be checked at run time. MINIX does not use this facility.
20 * The run-time limits are those given in <limits.h>.
27 /* Fstat the file. If that fails, return -1. */
28 if (fstat(fd
, &stbuf
) != 0) return(-1);
29 if (S_ISDIR(stbuf
.st_mode
))
30 return(1L); /* no links to directories */
32 return( (long) LINK_MAX
);
35 return( (long) MAX_CANON
);
38 return( (long) MAX_INPUT
);
41 return( (long) NAME_MAX
);
44 return( (long) PATH_MAX
);
47 return( (long) PIPE_BUF
);
49 case _PC_CHOWN_RESTRICTED
:
50 return( (long) _POSIX_CHOWN_RESTRICTED
);
53 return( (long) _POSIX_NO_TRUNC
);
56 return( (long) _POSIX_VDISABLE
);