[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


frevoke Subroutine

Purpose

Revokes access to a file by other processes.

Library

Standard C Library (libc.a)

Syntax


int frevoke ( FileDescriptor)
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.

Note: The frevoke subroutine has no affect on subsequent attempts to open the file. To ensure exclusive access to the file, the caller should change the mode of the file before issuing the frevoke subroutine. Currently the frevoke subroutine works only on terminal devices.

Parameters


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:

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.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]