1 /* POSIX fpathconf (Sec. 5.7.1) Author: Andy Tanenbaum */
14 __weak_alias(fpathconf
, _fpathconf
)
17 long fpathconf(fd
, name
)
18 int fd
; /* file descriptor being interrogated */
19 int name
; /* property being inspected */
21 /* POSIX allows some of the values in <limits.h> to be increased at
22 * run time. The pathconf and fpathconf functions allow these values
23 * to be checked at run time. MINIX does not use this facility.
24 * The run-time limits are those given in <limits.h>.
31 /* Fstat the file. If that fails, return -1. */
32 if (fstat(fd
, &stbuf
) != 0) return(-1);
33 if (S_ISDIR(stbuf
.st_mode
))
34 return(1L); /* no links to directories */
36 return( (long) LINK_MAX
);
39 return( (long) MAX_CANON
);
42 return( (long) MAX_INPUT
);
45 return( (long) NAME_MAX
);
48 return( (long) PATH_MAX
);
51 return( (long) PIPE_BUF
);
53 case _PC_CHOWN_RESTRICTED
:
54 return( (long) _POSIX_CHOWN_RESTRICTED
);
57 return( (long) _POSIX_NO_TRUNC
);
60 return( (long) _POSIX_VDISABLE
);