BSD 4_3 release
[unix-history] / usr / man / man2 / stat.2
index 4ad75bd..ddbd2e8 100644 (file)
@@ -1,4 +1,10 @@
-.TH STAT 2 "27 July 1983"
+.\" Copyright (c) 1980 Regents of the University of California.
+.\" All rights reserved.  The Berkeley software License Agreement
+.\" specifies the terms and conditions for redistribution.
+.\"
+.\"    @(#)stat.2      6.5 (Berkeley) 5/12/86
+.\"
+.TH STAT 2 "May 12, 1986"
 .UC 4
 .SH NAME
 stat, lstat, fstat \- get file status
 .UC 4
 .SH NAME
 stat, lstat, fstat \- get file status
@@ -106,6 +112,7 @@ Changed by the following system calls:
 .IR chown (2),
 .IR link (2),
 .IR mknod (2),
 .IR chown (2),
 .IR link (2),
 .IR mknod (2),
+.IR rename (2),
 .IR unlink (2),
 .IR utimes (2),
 .IR write (2).
 .IR unlink (2),
 .IR utimes (2),
 .IR write (2).
@@ -133,14 +140,6 @@ The status information word \fIst_mode\fP has bits:
 The mode bits 0000070 and 0000007 encode group and
 others permissions (see
 .IR chmod (2)).
 The mode bits 0000070 and 0000007 encode group and
 others permissions (see
 .IR chmod (2)).
-.PP
-When
-.I fd
-is associated with a pipe,
-.I fstat
-reports an ordinary file with an i-node number,
-restricted permissions,
-and a not necessarily meaningful length.
 .SH "RETURN VALUE
 Upon successful completion a value of 0 is returned.
 Otherwise, a value of \-1 is returned and
 .SH "RETURN VALUE
 Upon successful completion a value of 0 is returned.
 Otherwise, a value of \-1 is returned and
@@ -155,11 +154,12 @@ will fail if one or more of the following are true:
 [ENOTDIR]
 A component of the path prefix is not a directory.
 .TP 15
 [ENOTDIR]
 A component of the path prefix is not a directory.
 .TP 15
-[EPERM]
+[EINVAL]
 The pathname contains a character with the high-order bit set.
 .TP 15
 The pathname contains a character with the high-order bit set.
 .TP 15
-[ENOENT]
-The pathname was too long.
+[ENAMETOOLONG]
+A component of a pathname exceeded 255 characters,
+or an entire path name exceeded 1023 characters.
 .TP 15
 [ENOENT]
 The named file does not exist.
 .TP 15
 [ENOENT]
 The named file does not exist.
@@ -167,11 +167,17 @@ The named file does not exist.
 [EACCES]
 Search permission is denied for a component of the path prefix.
 .TP 15
 [EACCES]
 Search permission is denied for a component of the path prefix.
 .TP 15
+[ELOOP]
+Too many symbolic links were encountered in translating the pathname.
+.TP 15
 [EFAULT]
 .I Buf
 or
 .I name
 points to an invalid address.
 [EFAULT]
 .I Buf
 or
 .I name
 points to an invalid address.
+.TP 15
+[EIO]
+An I/O error occurred while reading from or writing to the file system.
 .PP
 .I Fstat
 will fail if one or both of the following are true:
 .PP
 .I Fstat
 will fail if one or both of the following are true:
@@ -184,8 +190,8 @@ is not a valid open file descriptor.
 .I Buf
 points to an invalid address.
 .TP 15
 .I Buf
 points to an invalid address.
 .TP 15
-[ELOOP]
-Too many symbolic links were encountered in translating the pathname.
+[EIO]
+An I/O error occurred while reading from or writing to the file system.
 .SH CAVEAT
 The fields in the stat structure currently marked 
 .IR st_spare1 ,
 .SH CAVEAT
 The fields in the stat structure currently marked 
 .IR st_spare1 ,
@@ -193,7 +199,7 @@ The fields in the stat structure currently marked
 and
 .I st_spare3
 are present in preparation for inode time stamps expanding
 and
 .I st_spare3
 are present in preparation for inode time stamps expanding
-to 64 bits.  This, however, can break certain programs which
+to 64 bits.  This, however, can break certain programs that
 depend on the time stamps being contiguous (in calls to
 .IR utimes (2)).
 .SH "SEE ALSO"
 depend on the time stamps being contiguous (in calls to
 .IR utimes (2)).
 .SH "SEE ALSO"
@@ -201,7 +207,7 @@ chmod(2), chown(2), utimes(2)
 .SH BUGS
 Applying
 .I fstat
 .SH BUGS
 Applying
 .I fstat
-to a socket returns a zero'd buffer.
-.PP
-The list of calls which modify the various fields should be carefully
-checked with reality.
+to a socket (and thus to a pipe)
+returns a zero'd buffer,
+except for the blocksize field,
+and a unique device and inode number.