when opening a file in a process using open, the kernel tests the permissions based on the valid user ID of the process, but what if we want to test the actual user ID of the process for the file permissions? Linux provides access functions to implement this functionality. When the Set-user-id bit is not set, the actual user and the active user are consistent. Once the Set-user-id bit is set, the actual user and the active user may not be the same. =======================================================function Prototypes:function Parameters:
- Pathname: The file path name to test
- Mode: the permissions to test
return Value:
- return 0 upon successful invocation
- Return 1 if the call fails
======================================================The mode can be a few macros:R_OK: Test Read PermissionsW_OK: Test Write permissionsX_OK: Test Execution PermissionsF_OK: Test file exists
File and directory details (iii)---access functions in detail