POSIX.1 specifies that a failed link() to a directory must return EPERM,
and EMLINK was not documented; from Klaus Klein in PR standards/3397. Also documented EOPNOTSUPP for filesystems that don't support hard links.
This commit is contained in:
parent
b9a022ebe6
commit
b81091e992
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: link.2,v 1.7 1995/02/27 12:34:01 cgd Exp $
|
||||
.\" $NetBSD: link.2,v 1.8 1997/03/27 07:30:26 mikel Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@ -50,7 +50,7 @@ function call
|
||||
atomically creates the specified directory entry (hard link)
|
||||
.Fa name2
|
||||
with the attributes of the underlying object pointed at by
|
||||
.Fa name1
|
||||
.Fa name1 .
|
||||
If the link is successful: the link count of the underlying object
|
||||
is incremented;
|
||||
.Fa name1
|
||||
@ -76,9 +76,9 @@ both
|
||||
and
|
||||
.Fa name2
|
||||
must be in the same file system.
|
||||
Unless the caller is the super-user,
|
||||
.Fa name1
|
||||
may not be a directory.
|
||||
.Fa Name1
|
||||
may not be a directory unless the caller is the super-user
|
||||
and the file system containing it supports linking to directories.
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion, a value of 0 is returned. Otherwise,
|
||||
a value of -1 is returned and
|
||||
@ -109,6 +109,15 @@ Too many symbolic links were encountered in translating one of the pathnames.
|
||||
The file named by
|
||||
.Fa name1
|
||||
does not exist.
|
||||
.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
|
||||
@ -117,7 +126,10 @@ does exist.
|
||||
The file named by
|
||||
.Fa name1
|
||||
is a directory and the effective
|
||||
user ID is not super-user.
|
||||
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 EXDEV
|
||||
The link named by
|
||||
.Fa name2
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ufs_vnops.c,v 1.22 1997/01/30 09:52:27 tls Exp $ */
|
||||
/* $NetBSD: ufs_vnops.c,v 1.23 1997/03/27 07:30:25 mikel Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -627,7 +627,7 @@ ufs_link(v)
|
||||
#endif
|
||||
if (vp->v_type == VDIR) {
|
||||
VOP_ABORTOP(dvp, cnp);
|
||||
error = EISDIR;
|
||||
error = EPERM;
|
||||
goto out2;
|
||||
}
|
||||
if (dvp->v_mount != vp->v_mount) {
|
||||
|
Loading…
Reference in New Issue
Block a user