/* POSIX pathconf (Sec. 5.7.1) Author: Andy Tanenbaum */ #include #include "namespace.h" #include #include #include #include #ifdef __weak_alias __weak_alias(pathconf, _pathconf) #endif long pathconf(path, name) const char *path; /* name of file being interrogated */ int name; /* property being inspected */ { /* POSIX allows some of the values in to be increased at * run time. The pathconf and fpathconf functions allow these values * to be checked at run time. MINIX does not use this facility. * The run-time limits are those given in . */ int fd; long val; if ( (fd = open(path, O_RDONLY)) < 0) return(-1L); val = fpathconf(fd, name); close(fd); return(val); }