BSD 4_4 release
[unix-history] / usr / src / bin / ln / symlink.7
index 881478a..2e3b2d9 100644 (file)
@@ -1,29 +1,58 @@
-.\" Copyright (c) 1992 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1992, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" %sccs.include.redist.roff%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"    @(#)symlink.7   5.1 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.Dd 
+.\"    @(#)symlink.7   8.1 (Berkeley) 5/31/93
+.\"
+.Dd May 31, 1993
 .Dt SYMLINK 7
 .Os BSD 4
 .Sh NAME
 .Nm symlink
 .Dt SYMLINK 7
 .Os BSD 4
 .Sh NAME
 .Nm symlink
-.Nd describe symbolic link handling
+.Nd symbolic link handling
 .Sh SYMBOLIC LINK HANDLING
 .Sh SYMBOLIC LINK HANDLING
-Due to the fact that a symbolic link and its referenced object coexist 
-in the file system
-name space, confusion can arise in distinguishing between the link itself
-and the referenced object.  Traditionally, utilities and system calls
+Because a symbolic link and its referenced object coexist 
+in the filesystem name space,
+confusion can arise in distinguishing between the link itself
+and the referenced object.
+Traditionally, utilities and system calls
 have adopted their own link following conventions in an ad-hoc fashion.
 Rules for more a uniform approach are outlined here.
 .Pp
 Symbolic links are handled either by operating on the link itself, or by
 have adopted their own link following conventions in an ad-hoc fashion.
 Rules for more a uniform approach are outlined here.
 .Pp
 Symbolic links are handled either by operating on the link itself, or by
-operating on the object referenced by the link.  In the latter case,
-an application or system call is said to ``follow'' the link.  Symbolic
-links may reference other symbolic links, in which case links are
-dereferenced until an atomic object is found.  Cycles are avoided by
+operating on the object referenced by the link.
+In the latter case,
+an application or system call is said to ``follow'' the link.
+Symbolic links may reference other symbolic links, in which case links are
+dereferenced until an object that is not a symbolic link is found.
+Cycles are avoided by
 placing an upper limit on the number of links that may be followed.
 An error results if this limit is exceeded.
 .Pp
 placing an upper limit on the number of links that may be followed.
 An error results if this limit is exceeded.
 .Pp
@@ -39,8 +68,17 @@ The system calls that do not follow symbolic links are
 and
 .Xr unlink 2 .
 All other system calls follow the symbolic link.
 and
 .Xr unlink 2 .
 All other system calls follow the symbolic link.
+Unlike other filesystem objects,
+symbolic links do not have an owner, group, access mode, times, etc.
+Instead, these attributes are taken from the directory that
+contains the link.
+The only attributes returned from an
+.Xr lstat 2
+that refer to the symbolic link itself are the file type (S_IFLNK),
+size, blocks, and link count (always 1).
 .Pp
 .Pp
-The utilities that do not follow symbolic links are
+The utilities that do not follow symbolic links named as arguments
+are
 .Xr mv 1
 and
 .Xr rm 1 .
 .Xr mv 1
 and
 .Xr rm 1 .
@@ -57,14 +95,15 @@ However, if the
 option is specified,
 .Xr ls 1
 always follows symbolic links.
 option is specified,
 .Xr ls 1
 always follows symbolic links.
-All other utilities follow symbolic links.
+All other utilities follow symbolic links listed on the command line.
 .Pp
 .Pp
-Another issue in symbolic link handling is traversal of a file hierarchy.
+The third issue in symbolic link handling is traversal of a file
+hierarchy.
 File hierarchies can be traversed either ``logically'', by following
 symbolic links that point to directories, or ``physically'', by not
 File hierarchies can be traversed either ``logically'', by following
 symbolic links that point to directories, or ``physically'', by not
-following such links.  
+following such links.
 .Pp
 .Pp
-The following utilities can perform traversals:
+The following utilities can do traversals:
 .Xr chflags 1 ,
 .Xr chgrp 1 ,
 .Xr chmod 1 ,
 .Xr chflags 1 ,
 .Xr chgrp 1 ,
 .Xr chmod 1 ,
@@ -76,7 +115,7 @@ The following utilities can perform traversals:
 .Xr rm 1
 and
 .Xr tar 1 .
 .Xr rm 1
 and
 .Xr tar 1 .
-All of these utilities, except for
+All these utilities, except for
 .Xr cp ,
 .Xr ls
 and
 .Xr cp ,
 .Xr ls
 and