revoke.2freebsd

Langue: en

Autres versions - même langue

Version: 266030 (debian - 07/07/09)

Section: 2 (Appels système)


BSD mandoc

NAME

revoke - revoke file access

LIBRARY

Lb libc

SYNOPSIS

In unistd.h Ft int Fn revoke const char *path

DESCRIPTION

The Fn revoke system call invalidates all current open file descriptors in the system for the file named by Fa path . Subsequent operations on any such descriptors fail, with the exceptions that a Fn read from a character device file which has been revoked returns a count of zero (end of file), and a Fn close system call will succeed. If the file is a special file for a device which is open, the device close function is called as if all open references to the file had been closed.

Access to a file may be revoked only by its owner or the super user. The Fn revoke system call is currently supported only for block and character special device files. It is normally used to prepare a terminal device for a new login session, preventing any access by a previous user of the terminal.

RETURN VALUES

Rv -std revoke

ERRORS

Access to the named file is revoked unless one of the following:
Bq Er ENOTDIR
A component of the path prefix is not a directory.
Bq Er ENAMETOOLONG
A component of a pathname exceeded 255 characters, or an entire path name exceeded 1024 characters.
Bq Er ENOENT
The named file or a component of the path name does not exist.
Bq Er EACCES
Search permission is denied for a component of the path prefix.
Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
Bq Er EFAULT
The Fa path argument points outside the process's allocated address space.
Bq Er EINVAL
The implementation does not support the Fn revoke operation on the named file.
Bq Er EPERM
The caller is neither the owner of the file nor the super user.

SEE ALSO

close(2)

HISTORY

The Fn revoke system call first appeared in BSD 4.3 Reno