Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include	<unistd.h>
2
#include	<limits.h>
3
#include	<errno.h>
4
#include	<sys/limits.h>
5
 
6
long
7
pathconf(const char *, int name)
8
{
9
	switch(name)
10
	{
11
	case _PC_LINK_MAX:
12
		return LINK_MAX;
13
	case _PC_MAX_CANON:
14
		return MAX_CANON;
15
	case _PC_MAX_INPUT:
16
		return MAX_INPUT;
17
	case _PC_NAME_MAX:
18
		return NAME_MAX;
19
	case _PC_PATH_MAX:
20
		return PATH_MAX;
21
	case _PC_PIPE_BUF:
22
		return PIPE_BUF;
23
	case _PC_CHOWN_RESTRICTED:
24
#ifdef _POSIX_CHOWN_RESTRICTED
25
		return _POSIX_CHOWN_RESTRICTED;
26
#else
27
		return -1;
28
#endif
29
	case _PC_NO_TRUNC:
30
#ifdef _POSIX_NO_TRUNC
31
		return _POSIX_NO_TRUNC;
32
#else
33
		return -1;
34
#endif
35
	case _PC_VDISABLE:
36
#ifdef _POSIX_VDISABLE
37
		return _POSIX_VDISABLE;
38
#else
39
		return -1;
40
#endif
41
	}
42
	errno = EINVAL;
43
	return -1;
44
}
45
 
46
long
47
fpathconf(int, int name)
48
{
49
	return pathconf(0, name);
50
}
51