Rev | Line | |
---|
[9] | 1 | .TH READLINK 2 "March 17, 2006"
|
---|
| 2 | .UC 4
|
---|
| 3 | .SH NAME
|
---|
| 4 | readlink \- read the contents of a symlink
|
---|
| 5 | .SH SYNOPSIS
|
---|
| 6 | .nf
|
---|
| 7 | .ft B
|
---|
| 8 | #include <unistd.h>
|
---|
| 9 |
|
---|
| 10 | int readlink(const char *\fIpath\fP, char *\fIbuf\fP, size_t bufsize)
|
---|
| 11 | .fi
|
---|
| 12 | .ft R
|
---|
| 13 | .SH DESCRIPTION
|
---|
| 14 | The
|
---|
| 15 | .I readlink
|
---|
| 16 | call reads the contents of the symlink
|
---|
| 17 | .I name1
|
---|
| 18 | and returns it in
|
---|
| 19 | .I buf
|
---|
| 20 | up to a maximum of
|
---|
| 21 | .I bufsize
|
---|
| 22 | bytes. A terminating NUL byte is NOT put in the buffer.
|
---|
| 23 | .SH "RETURN VALUE
|
---|
| 24 | Upon successful completion, a value of 0 is returned. Otherwise,
|
---|
| 25 | a value of \-1 is returned and
|
---|
| 26 | .B errno
|
---|
| 27 | is set to indicate the error.
|
---|
| 28 | .SH "ERRORS
|
---|
| 29 | .B Readlink
|
---|
| 30 | will fail if one or more of the following are true:
|
---|
| 31 | .TP 15
|
---|
| 32 | [ENOTDIR]
|
---|
| 33 | A component of either path prefix is not a directory.
|
---|
| 34 | .TP 15
|
---|
| 35 | [ENAMETOOLONG]
|
---|
| 36 | A path name exceeds PATH_MAX characters.
|
---|
| 37 | .TP 15
|
---|
| 38 | [ENOENT]
|
---|
| 39 | A component of the path does not exist.
|
---|
| 40 | .TP 15
|
---|
| 41 | [EACCES]
|
---|
| 42 | A component of the path denies search permission.
|
---|
| 43 | .TP 15
|
---|
| 44 | [ELOOP]
|
---|
| 45 | Too many symbolic links were encountered in translating one of the pathnames.
|
---|
| 46 | .TP 15
|
---|
| 47 | [ENOENT]
|
---|
| 48 | The link named by \fIpath\fP does not exist.
|
---|
| 49 | .TP 15
|
---|
| 50 | [EFAULT]
|
---|
| 51 | The buffer specified is outside the process's allocated address space.
|
---|
| 52 | .SH "SEE ALSO"
|
---|
| 53 | .BR symlink (2),
|
---|
| 54 | .BR unlink (2).
|
---|
Note:
See
TracBrowser
for help on using the repository browser.