frevoke Subroutine
Purpose
Revokes access to a file by other processes.
Library
Standard C Library (libc.a)
Syntax
int FileDescriptor;
Description
The frevoke subroutine revokes access to a file by other processes.
All accesses to the file are revoked, except through the file descriptor specified by the FileDescriptor parameter to the frevoke subroutine. Subsequent attempts to access the file, using another file descriptor established before the frevoke subroutine was called, fail and cause the process to receive a return value of -1, and the errno global variable is set to EBADF .
A process can revoke access to a file only if its effective user ID is the same as the file owner ID or if the invoker has root user authority.
Parameters
Item | Description |
---|---|
FileDescriptor | A file descriptor returned by a successful open subroutine. |
Return Values
Upon successful completion, the frevoke subroutine returns a value of 0.
If the frevoke subroutine fails, it returns a value of -1 and the errno global variable is set to indicate the error.
Error Codes
The frevoke subroutine fails if the following is true:
Item | Description |
---|---|
EBADF | The FileDescriptor value is not the valid file descriptor of a terminal. |
EPERM | The effective user ID of the calling process is not the same as the file owner ID. |
EINVAL | Revocation of access rights is not implemented for this file. |