libutil: add O_NOCTTY back to old pty open code
[minix.git] / lib / libc / sys-minix / pathconf.c
blob24c86f5bcfca88f4a27fec3ee32801c61d711c6c
1 /* POSIX pathconf (Sec. 5.7.1) Author: Andy Tanenbaum */
3 #include <sys/cdefs.h>
4 #include "namespace.h"
5 #include <lib.h>
7 #include <fcntl.h>
8 #include <errno.h>
9 #include <unistd.h>
11 #ifdef __weak_alias
12 __weak_alias(pathconf, _pathconf)
13 #endif
15 long pathconf(path, name)
16 const char *path; /* name of file being interrogated */
17 int name; /* property being inspected */
19 /* POSIX allows some of the values in <limits.h> to be increased at
20 * run time. The pathconf and fpathconf functions allow these values
21 * to be checked at run time. MINIX does not use this facility.
22 * The run-time limits are those given in <limits.h>.
25 int fd;
26 long val;
28 if ( (fd = open(path, O_RDONLY)) < 0) return(-1L);
29 val = fpathconf(fd, name);
30 close(fd);
31 return(val);