1resolvepath(2)                   System Calls                   resolvepath(2)
2
3
4

NAME

6       resolvepath - resolve all symbolic links of a path name
7

SYNOPSIS

9       #include <unistd.h>
10
11       int resolvepath(const char *path, char *buf, size_t bufsiz);
12
13

DESCRIPTION

15       The  resolvepath()  function  fully  resolves all symbolic links in the
16       path name path into a resulting path name free of  symbolic  links  and
17       places the resulting path name in the buffer buf which has size bufsiz.
18       The resulting path name names the same file or directory as the  origi‐
19       nal  path name. All ``.'' components are eliminated and every non-lead‐
20       ing ``..'' component is eliminated together with its  preceding  direc‐
21       tory  component.  If leading ``..'' components reach to the root direc‐
22       tory, they are replaced by ``/''. If the number of bytes in the result‐
23       ing path name is less than bufsiz, the contents of the remainder of buf
24       are unspecified.
25

RETURN VALUES

27       Upon successful completion, resolvepath() returns the  count  of  bytes
28       placed  in  the  buffer.  Otherwise,  it returns  −1, leaves the buffer
29       unchanged, and sets errno to indicate the error.
30

ERRORS

32       The resolvepath() function will fail if:
33
34       EACCES          Search permission is denied for a component of the path
35                       prefix of path or for a path prefix component resulting
36                       from the resolution of a symbolic link.
37
38
39       EFAULT          The path or buf argument points to an illegal address.
40
41
42       EIO             An I/O error occurred while reading from the file  sys‐
43                       tem.
44
45
46       ENOENT          The  path argument is an empty string or a component of
47                       path or a path name component produced by  resolving  a
48                       symbolic link does not name an existing file.
49
50
51       ELOOP           Too  many  symbolic links were encountered in resolving
52                       path.
53
54
55       ENAMETOOLONG    The length of path exceeds PATH_MAX,  or  a  path  name
56                       component is longer than NAME_MAX. Path name resolution
57                       of a symbolic  link  produced  an  intermediate  result
58                       whose  length  exceeds  PATH_MAX  or  a component whose
59                       length exceeds NAME_MAX.
60
61
62       ENOTDIR         A component of the path prefix of path  or  of  a  path
63                       prefix  component  resulting  from  the resolution of a
64                       symbolic link is not a directory.
65
66

USAGE

68       No more than PATH_MAX bytes will be placed in the buffer.  Applications
69       should  not  assume  that the returned contents of the buffer are null-
70       terminated.
71

SEE ALSO

73       readlink(2), realpath(3C)
74
75
76
77SunOS 5.11                        12 May 1997                   resolvepath(2)
Impressum