diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libpty.tex | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libpty.tex')
-rw-r--r-- | sys/src/cmd/python/Doc/lib/libpty.tex | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libpty.tex b/sys/src/cmd/python/Doc/lib/libpty.tex new file mode 100644 index 000000000..2db75030b --- /dev/null +++ b/sys/src/cmd/python/Doc/lib/libpty.tex @@ -0,0 +1,44 @@ +\section{\module{pty} --- + Pseudo-terminal utilities} +\declaremodule{standard}{pty} + \platform{IRIX, Linux} +\modulesynopsis{Pseudo-Terminal Handling for SGI and Linux.} +\moduleauthor{Steen Lumholt}{} +\sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} + + +The \module{pty} module defines operations for handling the +pseudo-terminal concept: starting another process and being able to +write to and read from its controlling terminal programmatically. + +Because pseudo-terminal handling is highly platform dependant, there +is code to do it only for SGI and Linux. (The Linux code is supposed +to work on other platforms, but hasn't been tested yet.) + +The \module{pty} module defines the following functions: + +\begin{funcdesc}{fork}{} +Fork. Connect the child's controlling terminal to a pseudo-terminal. +Return value is \code{(\var{pid}, \var{fd})}. Note that the child +gets \var{pid} 0, and the \var{fd} is \emph{invalid}. The parent's +return value is the \var{pid} of the child, and \var{fd} is a file +descriptor connected to the child's controlling terminal (and also +to the child's standard input and output). +\end{funcdesc} + +\begin{funcdesc}{openpty}{} +Open a new pseudo-terminal pair, using \function{os.openpty()} if +possible, or emulation code for SGI and generic \UNIX{} systems. +Return a pair of file descriptors \code{(\var{master}, \var{slave})}, +for the master and the slave end, respectively. +\end{funcdesc} + +\begin{funcdesc}{spawn}{argv\optional{, master_read\optional{, stdin_read}}} +Spawn a process, and connect its controlling terminal with the current +process's standard io. This is often used to baffle programs which +insist on reading from the controlling terminal. + +The functions \var{master_read} and \var{stdin_read} should be +functions which read from a file-descriptor. The defaults try to read +1024 bytes each time they are called. +\end{funcdesc} |