Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ access(2) — NEWS-os 5.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(2)

stat(2)

intro(2)



access(2)                 SYSTEM CALLS                  access(2)



NAME
     access - determine accessibility of a file

SYNOPSIS
     #include <unistd.h>

     int access(const char *path, int amode);

DESCRIPTION
     path points to a path name naming a file.  access checks the
     named  file  for  accessibility according to the bit pattern
     contained in amode, using the real user ID in place  of  the
     effective  user  ID  and  the  real group ID in place of the
     effective group ID. The bit pattern contained  in  amode  is
     constructed  by an OR of the following constants (defined in
     <unistd.h>):

          ROK read
          WOK write
          XOK execute (search)
          FOK check existence of file

     Access to the file is denied if one or more of the following
     are true:

     EACCES              Search permission is denied  on  a  com-
                         ponent of the path prefix.

     EACCES              Permission bits of the file mode do  not
                         permit the requested access.

     EFAULT              path  points   outside   the   allocated
                         address space for the process.

     EINTR               A signal was caught  during  the  access
                         system call.

     ELOOP               Too many symbolic links were encountered
                         in translating path.

     EMULTIHOP           Components of path  require  hopping  to
                         multiple remote machines.

     ENAMETOOLONG        The length of the path argument  exceeds
                         {PATHMAX}, or the length of a path com-
                         ponent    exceeds    {NAMEMAX}    while
                         POSIXNOTRUNC is in effect.

     ENOTDIR             A component of the path prefix is not  a
                         directory.

     ENOENT              Read,   write,   or   execute   (search)



                                                                1





access(2)                 SYSTEM CALLS                  access(2)



                         permission  is requested for a null path
                         name.

     ENOENT              The named file does not exist.

     ENOLINK             path points to a remote machine and  the
                         link   to  that  machine  is  no  longer
                         active.

     EROFS               Write access is requested for a file  on
                         a read-only file system.

SEE ALSO
     chmod(2), stat(2)
     ``File Access Permission'' in intro(2)

DIAGNOSTICS
     If the requested access  is  permitted,  a  value  of  0  is
     returned.  Otherwise, a value of -1 is returned and errno is
     set to indicate the error.



































                                                                2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026