* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)tty_tty.c 7.11 (Berkeley) %G%
* Indirect driver for controlling tty.
#define cttyvp(p) ((p)->p_flag&SCTTY ? (p)->p_session->s_ttyvp : NULL)
struct proc
*p
= curproc
;
struct vnode
*ttyvp
= cttyvp(p
);
error
= VOP_ACCESS(ttyvp
,
(flag
&FREAD
? VREAD
: 0) | (flag
&FWRITE
? VWRITE
: 0), p
->p_ucred
);
return (VOP_OPEN(ttyvp
, flag
, NOCRED
));
register struct vnode
*ttyvp
= cttyvp(curproc
);
error
= VOP_READ(ttyvp
, uio
, flag
, NOCRED
);
cttywrite(dev
, uio
, flag
)
register struct vnode
*ttyvp
= cttyvp(curproc
);
error
= VOP_WRITE(ttyvp
, uio
, flag
, NOCRED
);
cttyioctl(dev
, cmd
, addr
, flag
)
struct vnode
*ttyvp
= cttyvp(curproc
);
if (!SESS_LEADER(curproc
)) {
curproc
->p_flag
&= ~SCTTY
;
return (VOP_IOCTL(ttyvp
, cmd
, addr
, flag
, NOCRED
));
struct vnode
*ttyvp
= cttyvp(curproc
);
return (1); /* try operation to get EOF/failure */
return (VOP_SELECT(ttyvp
, flag
, FREAD
|FWRITE
, NOCRED
));