blob: 85dd5267c5ab67bff915588bbddffef4751d3a5f [file] [log] [blame]
Fred Drakea4b5d581999-06-29 18:11:22 +00001%%%% LaTeX'ed and enhanced from comments in file
2%%%% Skipped some functions which seemed to be for private
3%%%% usage (decision debatable).
4
5\section{\module{pty} ---
6 Pseudo-terminal utilities}
7\declaremodule{standard}{pty}
8 \platform{IRIX, Linux} %XXX Is that the right way???
9\modulesynopsis{Pseudo-Terminal Handling for SGI and Linux.}
10\moduleauthor{Steen Lumholt}{}
11\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
12
13
14The \module{pty} module defines operations for handling the
15pseudo-terminal concept: starting another process and being able to
16write to and read from its controlling terminal programmatically.
17
18Because pseudo-terminal handling is highly platform dependant, there
19is code to do it only for SGI and Linux. (The Linux code is supposed
20to work on other platforms, but hasn't been tested yet.)
21
22The \module{pty} module defines the following functions:
23
24\begin{funcdesc}{fork}{}
25Fork. Connect the child's controlling terminal to a pseudo-terminal.
26Return value is \code{(\var{pid}, \var{fd})}. Note that the child
27gets \var{pid} 0, and the \var{fd} is \emph{invalid}. The parent's
28return value is the \var{pid} of the child, and \var{fd} is a file
29descriptor connected to the child's controlling terminal (and also
30to the child's standard input and output.
31\end{funcdesc}
32
33\begin{funcdesc}{spawn}{argv\optional{, master_read\optional{, stdin_read}}}
34Spawn a process, and connect its controlling terminal with the current
35process's standard io. This is often used to baffle programs which
36insist on reading from the controlling terminal.
37
38The functions \var{master_read} and \var{stdin_read} should be
39functions which read from a file-descriptor. The defaults try to read
401024 bytes each time they are called.
41\end{funcdesc}