1 /* POSIX fpathconf (Sec. 5.7.1) Author: Andy Tanenbaum */
5 #define fpathconf _fpathconf
12 PUBLIC
long fpathconf(fd
, name
)
13 int fd
; /* file descriptor being interrogated */
14 int name
; /* property being inspected */
16 /* POSIX allows some of the values in <limits.h> to be increased at
17 * run time. The pathconf and fpathconf functions allow these values
18 * to be checked at run time. MINIX does not use this facility.
19 * The run-time limits are those given in <limits.h>.
26 /* Fstat the file. If that fails, return -1. */
27 if (fstat(fd
, &stbuf
) != 0) return(-1);
28 if (S_ISDIR(stbuf
.st_mode
))
29 return(1L); /* no links to directories */
31 return( (long) LINK_MAX
);
34 return( (long) MAX_CANON
);
37 return( (long) MAX_INPUT
);
40 return( (long) NAME_MAX
);
43 return( (long) PATH_MAX
);
46 return( (long) PIPE_BUF
);
48 case _PC_CHOWN_RESTRICTED
:
49 return( (long) _POSIX_CHOWN_RESTRICTED
);
52 return( (long) _POSIX_NO_TRUNC
);
55 return( (long) _POSIX_VDISABLE
);