one too many levels of indirection (from ks@purdue)
[unix-history] / usr / src / lib / libc / sys / vhangup.2
CommitLineData
db6093a6
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
eff6446c 5.\" @(#)vhangup.2 6.2 (Berkeley) %G%
db6093a6 6.\"
481eef88 7.TH VHANGUP 2 ""
db6093a6
KM
8.UC 4
9.SH NAME
10vhangup \- virtually ``hangup'' the current control terminal
11.SH SYNOPSIS
12.B vhangup()
13.SH DESCRIPTION
14.I Vhangup
15is used by the initialization process
16.IR init (8)
b348647a
KM
17(among others) to arrange that users are given
18\*(lqclean\*(rq' terminals at login,
db6093a6
KM
19by revoking access of the previous users' processes to the terminal.
20To effect this,
21.I vhangup
22searches the system tables for references to the control terminal
23of the invoking process, revoking access permissions
eff6446c 24on each instance of the terminal that it finds.
db6093a6
KM
25Further attempts to access the terminal by the affected processes
26will yield i/o errors (EBADF).
27Finally,
28a hangup signal (SIGHUP) is sent to the process group of the
29control terminal.
30.SH SEE ALSO
31init (8)
32.SH BUGS
33Access to
34the control terminal via
35.B /dev/tty
36is still possible.
37.PP
eff6446c 38This call should be replaced by an automatic mechanism that
b348647a 39takes place on process exit.