]>
Commit | Line | Data |
---|---|---|
224c7076 A |
1 | --- realpath.3 2003-05-20 15:23:25.000000000 -0700 |
2 | +++ realpath.3.edit 2006-09-06 15:43:17.000000000 -0700 | |
3 | @@ -44,26 +44,28 @@ | |
4 | .Sh LIBRARY | |
5 | .Lb libc | |
6 | .Sh SYNOPSIS | |
7 | -.In sys/param.h | |
8 | .In stdlib.h | |
9 | .Ft "char *" | |
10 | -.Fn realpath "const char *pathname" "char resolved_path[PATH_MAX]" | |
11 | +.Fo realpath | |
12 | +.Fa "const char *restrict file_name" | |
13 | +.Fa "char *restrict resolved_name" | |
14 | +.Fc | |
15 | .Sh DESCRIPTION | |
16 | The | |
17 | .Fn realpath | |
18 | function resolves all symbolic links, extra | |
19 | .Dq / | |
20 | -characters and references to | |
21 | +characters, and references to | |
22 | .Pa /./ | |
23 | and | |
24 | .Pa /../ | |
25 | in | |
26 | -.Fa pathname , | |
27 | +.Fa file_name , | |
28 | and copies the resulting absolute pathname into | |
29 | the memory referenced by | |
30 | -.Fa resolved_path . | |
31 | +.Fa resolved_name . | |
32 | The | |
33 | -.Fa resolved_path | |
34 | +.Fa resolved_name | |
35 | argument | |
36 | .Em must | |
37 | refer to a buffer capable of storing at least | |
38 | @@ -74,9 +76,9 @@ | |
39 | .Fn realpath | |
40 | function will resolve both absolute and relative paths | |
41 | and return the absolute pathname corresponding to | |
42 | -.Fa pathname . | |
43 | -All but the last component of | |
44 | -.Fa pathname | |
45 | +.Fa file_name . | |
46 | +All components of | |
47 | +.Fa file_name | |
48 | must exist when | |
49 | .Fn realpath | |
50 | is called. | |
51 | @@ -84,14 +86,14 @@ | |
52 | The | |
53 | .Fn realpath | |
54 | function returns | |
55 | -.Fa resolved_path | |
56 | +.Fa resolved_name | |
57 | on success. | |
58 | If an error occurs, | |
59 | .Fn realpath | |
60 | returns | |
61 | -.Dv NULL , | |
62 | +.Dv NULL | |
63 | and | |
64 | -.Fa resolved_path | |
65 | +.Fa resolved_name | |
66 | contains the pathname which caused the problem. | |
67 | .Sh ERRORS | |
68 | The function | |
69 | @@ -100,7 +102,7 @@ | |
70 | .Va errno | |
71 | for any of the errors specified for the library functions | |
72 | .Xr lstat 2 , | |
73 | -.Xr readlink 2 | |
74 | +.Xr readlink 2 , | |
75 | and | |
76 | .Xr getcwd 3 . | |
77 | .Sh CAVEATS | |
78 | @@ -112,11 +114,26 @@ | |
79 | version always returns absolute pathnames, | |
80 | whereas the Solaris implementation will, | |
81 | under certain circumstances, return a relative | |
82 | -.Fa resolved_path | |
83 | +.Fa resolved_name | |
84 | when given a relative | |
85 | -.Fa pathname . | |
86 | +.Fa file_name . | |
87 | +.Sh LEGACY SYNOPSIS | |
88 | +.Fd #include <sys/param.h> | |
89 | +.Fd #include <stdlib.h> | |
90 | +.Pp | |
91 | +The include file | |
92 | +.In sys/param.h | |
93 | +is necessary. | |
94 | +.Sh LEGACY DESCRIPTION | |
95 | +In legacy mode, | |
96 | +the last component of | |
97 | +.Fa file_name | |
98 | +does not need to exist when | |
99 | +.Fn realpath | |
100 | +is called. | |
101 | .Sh "SEE ALSO" | |
102 | -.Xr getcwd 3 | |
103 | +.Xr getcwd 3 , | |
104 | +.Xr compat 5 | |
105 | .Sh HISTORY | |
106 | The | |
107 | .Fn realpath |