BSD 4_3_Reno release
[unix-history] / usr / src / lib / libc / sys / access.2
index 4ae3553..87164d7 100644 (file)
@@ -2,25 +2,17 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)access.2    6.2 (Berkeley) %G%
+.\"    @(#)access.2    6.6 (Berkeley) 5/13/90
 .\"
 .\"
-.TH ACCESS 2 ""
+.TH ACCESS 2 "May 13, 1990"
 .UC 4
 .SH NAME
 access \- determine accessibility of file
 .SH SYNOPSIS
 .nf
 .ft B
 .UC 4
 .SH NAME
 access \- determine accessibility of file
 .SH SYNOPSIS
 .nf
 .ft B
-#include <sys/file.h>
-.PP
-.ft B
-.ta 1.25i 1.6i
-#define R_OK   4       /* test for read permission */
-#define W_OK   2       /* test for write permission */
-#define X_OK   1       /* test for execute (search) permission */
-#define F_OK   0       /* test for presence of file */
-.PP
-.ft B
+#include <unistd.h>
+
 accessible = access(path, mode)
 int accessible;
 char *path;
 accessible = access(path, mode)
 int accessible;
 char *path;
@@ -34,15 +26,12 @@ file
 .I path
 for accessibility according to
 .IR mode ,
 .I path
 for accessibility according to
 .IR mode ,
-which is an inclusive or of the bits
-R_OK,
-W_OK
-and
-X_OK.
+which is the bitwise inclusive OR of the access permissions to be
+checked (R_OK for read permission, W_OK for write permission and X_OK
+for execute/search permission) or the existence test, F_OK.
 Specifying
 .I mode
 Specifying
 .I mode
-as F_OK (i.e. 0)
-tests whether the directories leading to the file can be
+as F_OK tests whether the directories leading to the file can be
 searched and the file exists.
 .PP
 The real user ID and the group access list
 searched and the file exists.
 .PP
 The real user ID and the group access list
@@ -78,8 +67,7 @@ A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 .TP 15
 [ENOENT]
 or an entire path name exceeded 1023 characters.
 .TP 15
 [ENOENT]
-Read, write, or execute (search) permission is requested for a null
-path name or the named file does not exist.
+The named file does not exist.
 .TP 15
 [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.
@@ -96,7 +84,7 @@ file that is being executed.
 .TP 15
 [EACCES]
 Permission bits of the file mode do not permit the requested
 .TP 15
 [EACCES]
 Permission bits of the file mode do not permit the requested
-access; or search permission is denied on a component of the
+access, or search permission is denied on a component of the
 path prefix.  The owner of a file has permission checked with
 respect to the ``owner'' read, write, and execute mode bits,
 members of the file's group other than the owner have permission
 path prefix.  The owner of a file has permission checked with
 respect to the ``owner'' read, write, and execute mode bits,
 members of the file's group other than the owner have permission
@@ -107,5 +95,8 @@ mode bits.
 [EFAULT]
 .I Path
 points outside the process's allocated address space.
 [EFAULT]
 .I Path
 points outside the process's allocated address space.
+.TP 15
+[EIO]
+An I/O error occurred while reading from or writing to the file system.
 .SH "SEE ALSO
 chmod(2), stat(2)
 .SH "SEE ALSO
 chmod(2), stat(2)