.TH ttwrite0() "" "" "Internal Kernel Routine"
.PC "Write to tty"
.B "#include <sys/io.h>"
.B "#include <sys/tty.h>"
\fBvoid ttwrite0(\fItp\^\fB, \fIiop\^\fB, \fIfunc1\^\fB, \fIarg1\^\fB, \fIfunc2\^\fB, \fIarg2\^\fB)\fR
\fBTTY *\fItp\^\fB; IO *\fIiop\^\fB; int (*\fIfunc1\^\fB)(), \fIarg1\^\fB, (*\fIfunc2\^\fB)(), \fIarg2\^\fB;\fR
.PP
.B ttwrite0()
moves data to an output queue associated with
.IR tp ,
from the I/O area referenced by
.IR iop .
If an error occurs, it calls
.B set_user_error()
with an appropriate value.
.PP
The following behavior allows a driver to prevent deadlocks between
coupled drivers, such as master-slave pairs of pseudoterminals.
If
.I func1
or
is not NULL, the function call
\fB(*\fIfunc1\^\fB)(\fIarg1\^\fB)\fR is performed whenever
.B ttwrite0()
is about to sleep.
Likewise, if
.I func2
is not NULL, \fB(*\fIfunc2\^\fB)(\fIarg2\^\fB)\fR
is performed whenever
.B ttwrite0()
is about to sleep.
.PP
\fBttwrite(\fItp\^\fB, \fIiop\^\fB)\fR
is equivalent to
\fBttwrite0(\fItp\^\fB, \fIiop\^\fB, 0, 0, 0, 0)\fR.
.SH "See Also"
.B
internal kernel routines
.R
