1<assertions> 2 <assertion id="1" tag="ref:XSH7: pt:CX"> 3 The access() function shall check the file named by the pathname pointed to by the path argument 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. 4 </assertion> 5 <assertion id="2" tag="ref:XSH7: pt:CX"> 6 The value of amode is either the bitwise-inclusive OR of the access permissions to be checked (R_OK, W_OK, X_OK) or the existence test (F_OK). 7 </assertion> 8 <assertion id="3" tag="ref:XSH7: pt:CX"> 9 If any access permissions are checked, each shall be checked individually, as described in XBD File Access Permissions , except that where that description refers to execute permission for a process with appropriate privileges, an implementation may indicate success for X_OK even if execute permission is not granted to any user. 10 </assertion> 11 <assertion id="5" tag="ref:XSH7: pt:CX"> 12 Upon successful completion, access() shall return 0. 13 </assertion> 14 <assertion id="6" tag="ref:XSH7: pt:CX"> 15 Upon unsuccessful completion, access() shall return -1. 16 </assertion> 17 <assertion id="7" tag="ref:XSH7: pt:CX"> 18 Upon unsuccessful completion, errno will be set to indicate the error. 19 </assertion> 20 <assertion id="8" tag="ref:XSH7: pt:CX"> 21 Upon unsuccessful completion, errno will be set to indicate the error. 22 </assertion> 23 <assertion id="9" tag="ref:XSH7: pt:CX"> 24 access() shall set EACCES if the permission bits of the file mode do not permit the requested access, or search permission is denied on a component of the path prefix. 25 </assertion> 26 <assertion id="10" tag="ref:XSH7: pt:CX"> 27 access() shall set EACCES if the search permission is denied on a component of the path prefix. 28 </assertion> 29 <assertion id="11" tag="ref:XSH7: pt:CX"> 30 access() shall set ELOOP if a loop exists in symbolic links encountered during resolution of the path argument. 31 </assertion> 32 <assertion id="12" tag="ref:XSH7: pt:CX"> 33 access() shall set ENAMETOOLONG if the length of a component of a pathname is longer than {NAME_MAX}. 34 </assertion> 35 <assertion id="13" tag="ref:XSH7: pt:CX"> 36 access() shall set ENOENT if a component of path does not name an existing file. 37 </assertion> 38 <assertion id="14" tag="ref:XSH7: pt:CX"> 39 access() shall set ENOENT if path is an empty string. 40 </assertion> 41 <assertion id="15" tag="ref:XSH7: pt:CX"> 42 assert() shall set ENOTDIR if a component of the path prefix is not a directory. 43 </assertion> 44 <assertion id="16" tag="ref:XSH7: pt:CX"> 45 assert() shall set ENOTDIR if the path argument contains at least one non- >slash< character and ends with one or more trailing >slash< characters and the last pathname component names an existing file that is neither a directory nor a symbolic link to a directory.. 46 </assertion> 47 <assertion id="17" tag="ref:XSH7: pt:CX"> 48 assert() shall set EROFS if write access is requested for a file on a read-only file system. 49 </assertion> 50 <assertion id="18" tag="ref:XSH7: pt:CX"> 51 assert() shall set EINVAL if the value of the amode argument is invalid.. 52 </assertion> 53 <assertion id="19" tag="ref:XSH7: pt:CX"> 54 assert() shall set ELOOP if more than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument. 55 </assertion> 56 <assertion id="20" tag="ref:XSH7: pt:CX"> 57 assert() shall set ENAMETOOLONG if the length of a pathname exceeds {PATH_MAX}, or pathname resolution of a symbolic link produced an intermediate result with a length that exceeds {PATH_MAX}. 58 </assertion> 59 <assertion id="21" tag="ref:XSH7: pt:CX"> 60 assert() shall set ETXTBSY if the write access is requested for a pure procedure (shared text) file that is being executed. 61 </assertion> 62</assertions> 63