Readlink, symlink manpage; fix for lstat
This commit is contained in:
parent
827159c8ea
commit
ce64a1d542
54
man/man2/readlink.2
Normal file
54
man/man2/readlink.2
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
.TH READLINK 2 "March 17, 2006"
|
||||||
|
.UC 4
|
||||||
|
.SH NAME
|
||||||
|
readlink \- read the contents of a symlink
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.ft B
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int readlink(const char *\fIpath\fP, char *\fIbuf\fP, size_t bufsize)
|
||||||
|
.fi
|
||||||
|
.ft R
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.I readlink
|
||||||
|
call reads the contents of the symlink
|
||||||
|
.I name1
|
||||||
|
and returns it in
|
||||||
|
.I buf
|
||||||
|
up to a maximum of
|
||||||
|
.I bufsize
|
||||||
|
bytes. A terminating NUL byte is NOT put in the buffer.
|
||||||
|
.SH "RETURN VALUE
|
||||||
|
Upon successful completion, a value of 0 is returned. Otherwise,
|
||||||
|
a value of \-1 is returned and
|
||||||
|
.B errno
|
||||||
|
is set to indicate the error.
|
||||||
|
.SH "ERRORS
|
||||||
|
.B Readlink
|
||||||
|
will fail if one or more of the following are true:
|
||||||
|
.TP 15
|
||||||
|
[ENOTDIR]
|
||||||
|
A component of either path prefix is not a directory.
|
||||||
|
.TP 15
|
||||||
|
[ENAMETOOLONG]
|
||||||
|
A path name exceeds PATH_MAX characters.
|
||||||
|
.TP 15
|
||||||
|
[ENOENT]
|
||||||
|
A component of the path does not exist.
|
||||||
|
.TP 15
|
||||||
|
[EACCES]
|
||||||
|
A component of the path denies search permission.
|
||||||
|
.TP 15
|
||||||
|
[ELOOP]
|
||||||
|
Too many symbolic links were encountered in translating one of the pathnames.
|
||||||
|
.TP 15
|
||||||
|
[ENOENT]
|
||||||
|
The link named by \fIpath\fP does not exist.
|
||||||
|
.TP 15
|
||||||
|
[EFAULT]
|
||||||
|
The buffer specified is outside the process's allocated address space.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR symlink (2),
|
||||||
|
.BR unlink (2).
|
|
@ -16,7 +16,7 @@ stat, lstat, fstat \- get file status
|
||||||
|
|
||||||
.ta +54n
|
.ta +54n
|
||||||
int stat(const char *\fIpath\fP, struct stat *\fIbuf\fP)
|
int stat(const char *\fIpath\fP, struct stat *\fIbuf\fP)
|
||||||
int lstat(const char *\fIpath\fP, struct stat *\fIbuf\fP) (Minix-vmd)
|
int lstat(const char *\fIpath\fP, struct stat *\fIbuf\fP)
|
||||||
int fstat(int \fIfd\fP, struct stat *\fIbuf\fP)
|
int fstat(int \fIfd\fP, struct stat *\fIbuf\fP)
|
||||||
.fi
|
.fi
|
||||||
.ft R
|
.ft R
|
||||||
|
@ -36,7 +36,6 @@ returns information about the link,
|
||||||
while
|
while
|
||||||
.B stat
|
.B stat
|
||||||
returns information about the file the link references.
|
returns information about the file the link references.
|
||||||
(Minix-vmd) (Under minix, lstat behaves like stat.)
|
|
||||||
.PP
|
.PP
|
||||||
.B Fstat
|
.B Fstat
|
||||||
obtains the same information about an open file
|
obtains the same information about an open file
|
||||||
|
@ -119,7 +118,7 @@ The file type information in \fBst_mode\fP has bits:
|
||||||
#define\ \ \ \ S_IFDIR 0040000 /* directory */
|
#define\ \ \ \ S_IFDIR 0040000 /* directory */
|
||||||
#define\ \ \ \ S_IFBLK 0060000 /* block special */
|
#define\ \ \ \ S_IFBLK 0060000 /* block special */
|
||||||
#define\ \ \ \ S_IFREG 0100000 /* regular */
|
#define\ \ \ \ S_IFREG 0100000 /* regular */
|
||||||
#define\ \ \ \ S_IFLNK 0120000 /* symbolic link (Minix-vmd) */
|
#define\ \ \ \ S_IFLNK 0120000 /* symbolic link */
|
||||||
.fi
|
.fi
|
||||||
.in -5n
|
.in -5n
|
||||||
.PP
|
.PP
|
||||||
|
@ -151,7 +150,6 @@ Search permission is denied for a component of the path prefix.
|
||||||
.TP 15
|
.TP 15
|
||||||
[ELOOP]
|
[ELOOP]
|
||||||
Too many symbolic links were encountered in translating the pathname.
|
Too many symbolic links were encountered in translating the pathname.
|
||||||
(Minix-vmd)
|
|
||||||
.TP 15
|
.TP 15
|
||||||
[EFAULT]
|
[EFAULT]
|
||||||
.I Buf
|
.I Buf
|
||||||
|
|
77
man/man2/symlink.2
Normal file
77
man/man2/symlink.2
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
.TH SYMLINK 2 "March 17, 2006"
|
||||||
|
.UC 4
|
||||||
|
.SH NAME
|
||||||
|
symlink \- make a symbolic link to a file
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.ft B
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int symlink(const char *\fIname1\fP, const char *\fIname2\fP)
|
||||||
|
.fi
|
||||||
|
.ft R
|
||||||
|
.SH DESCRIPTION
|
||||||
|
A symbolic link
|
||||||
|
.I name2
|
||||||
|
is created.
|
||||||
|
The link has the name
|
||||||
|
.IR name1 .
|
||||||
|
.SH "RETURN VALUE
|
||||||
|
Upon successful completion, a value of 0 is returned. Otherwise,
|
||||||
|
a value of \-1 is returned and
|
||||||
|
.B errno
|
||||||
|
is set to indicate the error.
|
||||||
|
.SH "ERRORS
|
||||||
|
.B Symlink
|
||||||
|
will fail and no link will be created if one or more of the following
|
||||||
|
are true:
|
||||||
|
.TP 15
|
||||||
|
[ENOTDIR]
|
||||||
|
A component of either path prefix is not a directory.
|
||||||
|
.TP 15
|
||||||
|
[ENAMETOOLONG]
|
||||||
|
A path name exceeds PATH_MAX characters.
|
||||||
|
.TP 15
|
||||||
|
[ENOENT]
|
||||||
|
A component of either path prefix does not exist.
|
||||||
|
.TP 15
|
||||||
|
[EACCES]
|
||||||
|
A component of either path prefix denies search permission.
|
||||||
|
.TP 15
|
||||||
|
[EACCES]
|
||||||
|
The requested link requires writing in a directory with a mode
|
||||||
|
that denies write permission.
|
||||||
|
.TP 15
|
||||||
|
[ELOOP]
|
||||||
|
Too many symbolic links were encountered in translating one of the pathnames.
|
||||||
|
.TP 15
|
||||||
|
[EEXIST]
|
||||||
|
The link named by \fIname2\fP exists.
|
||||||
|
.TP 15
|
||||||
|
[ENOSPC]
|
||||||
|
The directory in which the entry for the new link is being placed
|
||||||
|
cannot be extended because there is no space left on the file
|
||||||
|
system containing the directory.
|
||||||
|
.ig
|
||||||
|
.TP 15
|
||||||
|
[EDQUOT]
|
||||||
|
The directory in which the entry for the new link
|
||||||
|
is being placed cannot be extended because the
|
||||||
|
user's quota of disk blocks on the file system
|
||||||
|
containing the directory has been exhausted.
|
||||||
|
..
|
||||||
|
.TP 15
|
||||||
|
[EIO]
|
||||||
|
An I/O error occurred while reading from or writing to
|
||||||
|
the file system to make the directory entry.
|
||||||
|
.TP 15
|
||||||
|
[EROFS]
|
||||||
|
The requested link requires writing in a directory on a read-only file
|
||||||
|
system.
|
||||||
|
.TP 15
|
||||||
|
[EFAULT]
|
||||||
|
One of the pathnames specified
|
||||||
|
is outside the process's allocated address space.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR link (2),
|
||||||
|
.BR unlink (2).
|
Loading…
Reference in a new issue