4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * pathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.OARcorp.com/rtems/license.html. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #include <unistd.h> |
---|
15 | #include <errno.h> |
---|
16 | #include <sys/types.h> |
---|
17 | #include <sys/stat.h> |
---|
18 | #include <fcntl.h> |
---|
19 | |
---|
20 | long pathconf( |
---|
21 | const char *path, |
---|
22 | int name |
---|
23 | ) |
---|
24 | { |
---|
25 | int status; |
---|
26 | int fd; |
---|
27 | |
---|
28 | fd = open( path, O_RDONLY ); |
---|
29 | if ( fd == -1 ) |
---|
30 | return -1; |
---|
31 | |
---|
32 | status = fpathconf( fd, name ); |
---|
33 | |
---|
34 | (void) close( fd ); |
---|
35 | |
---|
36 | return status; |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.