Commit | Line | Data |
---|---|---|
69e3a22f KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
fd690c8b | 5 | .\" @(#)readlink.2 6.4 (Berkeley) %G% |
69e3a22f | 6 | .\" |
1acc446f | 7 | .TH READLINK 2 "" |
69e3a22f KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | readlink \- read value of a symbolic link | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .ft B | |
14 | cc = readlink(path, buf, bufsiz) | |
15 | int cc; | |
16 | char *path, *buf; | |
17 | int bufsiz; | |
18 | .fi | |
19 | .ft R | |
20 | .SH DESCRIPTION | |
21 | .I Readlink | |
22 | places the contents of the symbolic link | |
23 | .I name | |
24 | in the buffer | |
0ed030a0 | 25 | .I buf, |
69e3a22f KM |
26 | which has size |
27 | .IR bufsiz . | |
28 | The contents of the link are not null terminated when returned. | |
29 | .SH "RETURN VALUE | |
30 | The call returns the count of characters placed in the buffer | |
31 | if it succeeds, or a \-1 if an error occurs, placing the error | |
32 | code in the global variable \fIerrno\fP. | |
33 | .SH "ERRORS | |
34 | .I Readlink | |
35 | will fail and the file mode will be unchanged if: | |
36 | .TP 15 | |
69e3a22f KM |
37 | [ENOTDIR] |
38 | A component of the path prefix is not a directory. | |
39 | .TP 15 | |
b5984ffe KM |
40 | [EINVAL] |
41 | The pathname contains a character with the high-order bit set. | |
42 | .TP 15 | |
43 | [ENAMETOOLONG] | |
44 | A component of a pathname exceeded 255 characters, | |
45 | or an entire path name exceeded 1023 characters. | |
46 | .TP 15 | |
69e3a22f KM |
47 | [ENOENT] |
48 | The named file does not exist. | |
49 | .TP 15 | |
69e3a22f | 50 | [EACCES] |
b5984ffe | 51 | Search permission is denied for a component of the path prefix. |
69e3a22f | 52 | .TP 15 |
b5984ffe KM |
53 | [ELOOP] |
54 | Too many symbolic links were encountered in translating the pathname. | |
69e3a22f KM |
55 | .TP 15 |
56 | [EINVAL] | |
57 | The named file is not a symbolic link. | |
58 | .TP 15 | |
fd690c8b KM |
59 | [EIO] |
60 | An I/O error occurred while reading from the file system. | |
61 | .TP 15 | |
69e3a22f KM |
62 | [EFAULT] |
63 | .I Buf | |
64 | extends outside the process's allocated address space. | |
69e3a22f KM |
65 | .SH SEE ALSO |
66 | stat(2), lstat(2), symlink(2) |