summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-06-29 18:11:22 (GMT)
committerFred Drake <fdrake@acm.org>1999-06-29 18:11:22 (GMT)
commita4b5d587909656340cc3adecc2538b6e7996e3ca (patch)
tree31f099fd2e037043db7958987b52705f82b0bba1
parent31d10cbe2658e479d019f101f5055ed6c1459bb6 (diff)
downloadcpython-a4b5d587909656340cc3adecc2538b6e7996e3ca.zip
cpython-a4b5d587909656340cc3adecc2538b6e7996e3ca.tar.gz
cpython-a4b5d587909656340cc3adecc2538b6e7996e3ca.tar.bz2
pty documentation from Moshe; with small edits.
-rw-r--r--Doc/lib/libpty.tex41
1 files changed, 41 insertions, 0 deletions
diff --git a/Doc/lib/libpty.tex b/Doc/lib/libpty.tex
new file mode 100644
index 0000000..85dd526
--- /dev/null
+++ b/Doc/lib/libpty.tex
@@ -0,0 +1,41 @@
+%%%% LaTeX'ed and enhanced from comments in file
+%%%% Skipped some functions which seemed to be for private
+%%%% usage (decision debatable).
+
+\section{\module{pty} ---
+ Pseudo-terminal utilities}
+\declaremodule{standard}{pty}
+ \platform{IRIX, Linux} %XXX Is that the right way???
+\modulesynopsis{Pseudo-Terminal Handling for SGI and Linux.}
+\moduleauthor{Steen Lumholt}{}
+\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
+
+
+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}{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}