describe lstat of symbolic links
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 1 Jun 1993 07:59:27 +0000 (23:59 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 1 Jun 1993 07:59:27 +0000 (23:59 -0800)
SCCS-vsn: bin/ln/symlink.7 5.3

usr/src/bin/ln/symlink.7

index f72ae32..497945a 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)symlink.7   5.2 (Berkeley) %G%
+.\"    @(#)symlink.7   5.3 (Berkeley) %G%
 .\"
 .Dd 
 .Dt SYMLINK 7
 .\"
 .Dd 
 .Dt SYMLINK 7
 .Nm symlink
 .Nd symbolic link handling
 .Sh SYMBOLIC LINK HANDLING
 .Nm symlink
 .Nd 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 object which is not a symbolic link is found.
+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.
 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.
@@ -40,6 +42,14 @@ 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
 The utilities that do not follow symbolic links named as arguments
 are
 .Pp
 The utilities that do not follow symbolic links named as arguments
 are
@@ -65,9 +75,9 @@ 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
 hierarchy.
 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 ,
@@ -79,7 +89,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