fix copyright and condition notice for new sccs include
[unix-history] / usr / src / lib / libc / sys / access.2
index fb03a68..b3c78ce 100644 (file)
@@ -2,7 +2,7 @@
 .\" 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.1 (Berkeley) %G%
+.\"    @(#)access.2    6.6 (Berkeley) %G%
 .\"
 .TH ACCESS 2 ""
 .UC 4
 .\"
 .TH ACCESS 2 ""
 .UC 4
@@ -11,16 +11,8 @@ access \- determine accessibility of file
 .SH SYNOPSIS
 .nf
 .ft B
 .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
@@ -70,15 +59,18 @@ Access to the file is denied 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
-[ENOENT]
-The argument path name was too long.
+[EINVAL]
+The pathname contains a character with the high-order bit set.
+.TP 15
+[ENAMETOOLONG]
+A component of a pathname exceeded 255 characters,
+or an entire path name exceeded 1023 characters.
 .TP 15
 [ENOENT]
 .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
 .TP 15
-[EPERM]
-The argument contains a byte with the high-order bit set.
+[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
 [ELOOP]
 Too many symbolic links were encountered in translating the pathname.
@@ -92,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
@@ -103,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)