Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
+66
-40
@@ -1,6 +1,6 @@
|
||||
.\" $NetBSD: link.2,v 1.24 2010/05/31 12:16:20 njoly Exp $
|
||||
.\" $NetBSD: link.2,v 1.26 2011/08/08 19:50:17 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1991, 1993
|
||||
.\" Copyright (c) 1980, 1991, 1993, 2011
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
@@ -41,6 +41,8 @@
|
||||
.In unistd.h
|
||||
.Ft int
|
||||
.Fn link "const char *name1" "const char *name2"
|
||||
.Ft int
|
||||
.Fn linkat "int fd1" "const char *name1" "int fd2" "const char *name2" "int flags"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn link
|
||||
@@ -77,6 +79,28 @@ must be in the same file system.
|
||||
.Fa name1
|
||||
may not be a directory unless the caller is the super-user
|
||||
and the file system containing it supports linking to directories.
|
||||
.Pp
|
||||
When operating on a symlink,
|
||||
.Fn link
|
||||
resolves the symlink and creates a hard link on the target.
|
||||
.Fn linkat
|
||||
will do the same if
|
||||
.Dv AT_SYMLINK_FOLLOW
|
||||
is set in
|
||||
.Fa flags ,
|
||||
but it will link on the symlink itself if the flag is clear.
|
||||
.Pp
|
||||
At the moment,
|
||||
.Fn linkat
|
||||
is partially implemented.
|
||||
It will return
|
||||
.Er ENOSYS
|
||||
for
|
||||
.Fa fd1
|
||||
and
|
||||
.Fa fd2
|
||||
values different than
|
||||
.Dv AT_FDCWD .
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion, a value of 0 is returned.
|
||||
Otherwise, a value of \-1 is returned and
|
||||
@@ -86,8 +110,32 @@ is set to indicate the error.
|
||||
.Fn link
|
||||
will fail and no link will be created if:
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er ENOTDIR
|
||||
A component of either path prefix is not a directory.
|
||||
.It Bq Er EACCES
|
||||
A component of either path prefix denies search permission, or
|
||||
the requested link requires writing in a directory with a mode
|
||||
that denies write permission.
|
||||
.It Bq Er 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.
|
||||
.It Bq Er EEXIST
|
||||
The link named by
|
||||
.Fa name2
|
||||
does exist.
|
||||
.It Bq Er EFAULT
|
||||
One of the pathnames specified
|
||||
is outside the process's allocated address space.
|
||||
.It Bq Er EIO
|
||||
An I/O error occurred while reading from or writing to
|
||||
the file system to make the directory entry.
|
||||
.It Bq Er ELOOP
|
||||
Too many symbolic links were encountered in translating one of the pathnames.
|
||||
.It Bq Er EMLINK
|
||||
The link count of the file named by
|
||||
.Fa name1
|
||||
would exceed
|
||||
.Dv {LINK_MAX} .
|
||||
.It Bq Er ENAMETOOLONG
|
||||
A component of a pathname exceeded
|
||||
.Brq Dv NAME_MAX
|
||||
@@ -95,30 +143,20 @@ characters, or an entire path name exceeded
|
||||
.Brq Dv PATH_MAX
|
||||
characters.
|
||||
.It Bq Er ENOENT
|
||||
A component of either path prefix does not exist.
|
||||
.It Bq Er EACCES
|
||||
A component of either path prefix denies search permission, or
|
||||
the requested link requires writing in a directory with a mode
|
||||
that denies write permission.
|
||||
.It Bq Er ELOOP
|
||||
Too many symbolic links were encountered in translating one of the pathnames.
|
||||
.It Bq Er ENOENT
|
||||
The file named by
|
||||
A component of either path prefix does not exist, or the file named
|
||||
by
|
||||
.Fa name1
|
||||
does not exist.
|
||||
.It Bq Er 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.
|
||||
.It Bq Er ENOTDIR
|
||||
A component of either path prefix is not a directory.
|
||||
.It Bq Er EOPNOTSUPP
|
||||
The file system containing the file named by
|
||||
.Fa name1
|
||||
does not support links.
|
||||
.It Bq Er EMLINK
|
||||
The link count of the file named by
|
||||
.Fa name1
|
||||
would exceed
|
||||
.Dv {LINK_MAX} .
|
||||
.It Bq Er EEXIST
|
||||
The link named by
|
||||
.Fa name2
|
||||
does exist.
|
||||
.It Bq Er EPERM
|
||||
The file named by
|
||||
.Fa name1
|
||||
@@ -127,30 +165,15 @@ user ID is not super-user,
|
||||
or the file system containing the file does not permit the use of
|
||||
.Fn link
|
||||
on a directory.
|
||||
.It Bq Er EROFS
|
||||
The requested link requires writing in a directory on a read-only file
|
||||
system.
|
||||
.It Bq Er EXDEV
|
||||
The link named by
|
||||
.Fa name2
|
||||
and the file named by
|
||||
.Fa name1
|
||||
are on different file systems.
|
||||
.It Bq Er 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.
|
||||
.It Bq Er 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.
|
||||
.It Bq Er EIO
|
||||
An I/O error occurred while reading from or writing to
|
||||
the file system to make the directory entry.
|
||||
.It Bq Er EROFS
|
||||
The requested link requires writing in a directory on a read-only file
|
||||
system.
|
||||
.It Bq Er EFAULT
|
||||
One of the pathnames specified
|
||||
is outside the process's allocated address space.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr symlink 2 ,
|
||||
@@ -160,3 +183,6 @@ The
|
||||
.Fn link
|
||||
function conforms to
|
||||
.St -p1003.1-90 .
|
||||
.Sh BUGS
|
||||
.Fn linkat
|
||||
is partially implemented.
|
||||
|
||||
Reference in New Issue
Block a user