1*61183Sbostic.\" Copyright (c) 1993 2*61183Sbostic.\" The Regents of the University of California. All rights reserved. 358264Smckusick.\" 458264Smckusick.\" This code is derived from software contributed to Berkeley by 558264Smckusick.\" Berkeley Software Design, Inc. 658264Smckusick.\" 758264Smckusick.\" %sccs.include.redist.man% 858264Smckusick.\" 9*61183Sbostic.\" @(#)revoke.2 8.1 (Berkeley) 06/04/93 1058264Smckusick.\" 1158264Smckusick.Dd 1258264Smckusick.Dt REVOKE 2 1358264Smckusick.Os 1458264Smckusick.Sh NAME 1558264Smckusick.Nm revoke 1658264Smckusick.Nd revoke file access 1758264Smckusick.Sh SYNOPSIS 1858264Smckusick.Ft int 1958264Smckusick.Fn revoke "char *path" 2058264Smckusick.Sh DESCRIPTION 2158264SmckusickThe 2258264Smckusick.Nm revoke 2358264Smckusickfunction invalidates all current open file descriptors in the system 2458264Smckusickfor the file named by 2558264Smckusick.Fa path . 2658264SmckusickSubsequent operations on any such descriptors 2758264Smckusickfail, with the exceptions that a 2858264Smckusick.Fn read 2958264Smckusickfrom a character device file which has been revoked 3058264Smckusickreturns a count of zero (end of file), 3158264Smckusickand a 3258264Smckusick.Fn close 3358264Smckusickcall will succeed. 3458264SmckusickIf the file is a special file for a device which is open, 3558264Smckusickthe device close function 3658264Smckusickis called as if all open references to the file had been closed. 3758264Smckusick.Pp 3858264SmckusickAccess to a file may be revoked only by its owner or the super user. 3958264SmckusickThe 4058264Smckusick.Nm revoke 4158264Smckusickfunction is currently supported only for block and character special 4258264Smckusickdevice files. 4358264SmckusickIt is normally used to prepare a terminal device for a new login session, 4458264Smckusickpreventing any access by a previous user of the terminal. 4558264Smckusick.Sh RETURN VALUES 4658264SmckusickA 0 value indicated that the call succeeded. A \-1 return value 4758264Smckusickindicates an error occurred and 4858264Smckusick.Va errno 4958264Smckusickis set to indicated the reason. 5058264Smckusick.Sh ERRORS 5158264SmckusickAccess to the named file is revoked unless one of the following: 5258264Smckusick.Bl -tag -width Er 5358264Smckusick.It Bq Er ENOTDIR 5458264SmckusickA component of the path prefix is not a directory. 5558264Smckusick.It Bq Er ENAMETOOLONG 5658264SmckusickA component of a pathname exceeded 255 characters, 5758264Smckusickor an entire path name exceeded 1024 characters. 5858264Smckusick.It Bq Er ENOENT 5958264SmckusickThe named file or a component of the path name does not exist. 6058264Smckusick.It Bq Er EACCES 6158264SmckusickSearch permission is denied for a component of the path prefix. 6258264Smckusick.It Bq Er ELOOP 6358264SmckusickToo many symbolic links were encountered in translating the pathname. 6458264Smckusick.It Bq Er EFAULT 6558264Smckusick.Fa Path 6658264Smckusickpoints outside the process's allocated address space. 6758264Smckusick.It Bq Er EINVAL 6858264SmckusickThe named file is neither a character special or block 6958264Smckusickspecial file. 7058264Smckusick.It Bq Er EPERM 7158264SmckusickThe caller is neither the owner of the file nor the super user. 7258264Smckusick.El 7358264Smckusick.Sh SEE ALSO 7458264Smckusick.Xr close 2 7558264Smckusick.Sh HISTORY 7658264SmckusickThe 7758264Smckusick.Nm revoke 7858264Smckusickfunction was introduced in 7958264Smckusick.Bx 4.3 Reno . 80