diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libc/stdlib/realpath.3 | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/src/lib/libc/stdlib/realpath.3 b/src/lib/libc/stdlib/realpath.3 index 5966b38058..6e253c87a3 100644 --- a/src/lib/libc/stdlib/realpath.3 +++ b/src/lib/libc/stdlib/realpath.3 | |||
| @@ -28,9 +28,9 @@ | |||
| 28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 29 | .\" SUCH DAMAGE. | 29 | .\" SUCH DAMAGE. |
| 30 | .\" | 30 | .\" |
| 31 | .\" $OpenBSD: realpath.3,v 1.19 2014/01/20 22:40:06 schwarze Exp $ | 31 | .\" $OpenBSD: realpath.3,v 1.20 2019/06/15 15:40:44 deraadt Exp $ |
| 32 | .\" | 32 | .\" |
| 33 | .Dd $Mdocdate: January 20 2014 $ | 33 | .Dd $Mdocdate: June 15 2019 $ |
| 34 | .Dt REALPATH 3 | 34 | .Dt REALPATH 3 |
| 35 | .Os | 35 | .Os |
| 36 | .Sh NAME | 36 | .Sh NAME |
| @@ -96,13 +96,43 @@ are undefined. | |||
| 96 | .Sh ERRORS | 96 | .Sh ERRORS |
| 97 | The function | 97 | The function |
| 98 | .Fn realpath | 98 | .Fn realpath |
| 99 | may fail and set the external variable | 99 | will fail if: |
| 100 | .Va errno | 100 | .Bl -tag -width Er |
| 101 | for any of the errors specified for the library functions | 101 | .It Bq Er EACCES |
| 102 | .Xr lstat 2 , | 102 | Read or search permission was denied for a component of |
| 103 | .Xr readlink 2 , | 103 | .Ar pathname . |
| 104 | and | 104 | .It Bq Er EINVAL |
| 105 | .Xr getcwd 3 . | 105 | The |
| 106 | .Ar pathname | ||
| 107 | argument is a null pointer. | ||
| 108 | .It Bq Er EIO | ||
| 109 | An error occurred while reading from the file system. | ||
| 110 | .It Bq Er ELOOP | ||
| 111 | Too many symbolic links were encountered in translating | ||
| 112 | .Ar pathname . | ||
| 113 | .It Bq Er ENAMETOOLONG | ||
| 114 | A component of | ||
| 115 | .Ar pathname | ||
| 116 | exceeded | ||
| 117 | .Dv NAME_MAX | ||
| 118 | characters, or the entire | ||
| 119 | .Ar pathname | ||
| 120 | (including the terminating NUL) exceeded | ||
| 121 | .Dv PATH_MAX . | ||
| 122 | .It Bq Er ENAMETOOLONG | ||
| 123 | Pathname resolution of a symbolic link produced an intermediate | ||
| 124 | result whose length exceeds | ||
| 125 | .Dv PATH_MAX . | ||
| 126 | .It Bq Er ENOENT | ||
| 127 | A component of | ||
| 128 | .Ar pathname | ||
| 129 | does not name an existing file or | ||
| 130 | .Ar pathname | ||
| 131 | points to an empty string. | ||
| 132 | .It Bq Er ENOTDIR | ||
| 133 | A component of the path prefix is not a directory. | ||
| 134 | .It Bq Er ENOMEM | ||
| 135 | Sufficient storage space is unavailable for allocation. | ||
| 106 | .Sh SEE ALSO | 136 | .Sh SEE ALSO |
| 107 | .Xr readlink 1 , | 137 | .Xr readlink 1 , |
| 108 | .Xr getcwd 3 | 138 | .Xr getcwd 3 |
| @@ -116,15 +146,3 @@ The | |||
| 116 | .Fn realpath | 146 | .Fn realpath |
| 117 | function call first appeared in | 147 | function call first appeared in |
| 118 | .Bx 4.4 . | 148 | .Bx 4.4 . |
| 119 | .Sh CAVEATS | ||
| 120 | This implementation of | ||
| 121 | .Fn realpath | ||
| 122 | differs slightly from the Solaris implementation. | ||
| 123 | The | ||
| 124 | .Bx 4.4 | ||
| 125 | version always returns absolute pathnames, | ||
| 126 | whereas the Solaris implementation will, | ||
| 127 | under certain circumstances, return a relative | ||
| 128 | .Fa resolved | ||
| 129 | when given a relative | ||
| 130 | .Fa pathname . | ||
