Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4b5d58

Browse files
committed
pty documentation from Moshe; with small edits.
1 parent 31d10cb commit a4b5d58

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Doc/lib/libpty.tex

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
%%%% 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}{[email protected]}
12+
13+
14+
The \module{pty} module defines operations for handling the
15+
pseudo-terminal concept: starting another process and being able to
16+
write to and read from its controlling terminal programmatically.
17+
18+
Because pseudo-terminal handling is highly platform dependant, there
19+
is code to do it only for SGI and Linux. (The Linux code is supposed
20+
to work on other platforms, but hasn't been tested yet.)
21+
22+
The \module{pty} module defines the following functions:
23+
24+
\begin{funcdesc}{fork}{}
25+
Fork. Connect the child's controlling terminal to a pseudo-terminal.
26+
Return value is \code{(\var{pid}, \var{fd})}. Note that the child
27+
gets \var{pid} 0, and the \var{fd} is \emph{invalid}. The parent's
28+
return value is the \var{pid} of the child, and \var{fd} is a file
29+
descriptor connected to the child's controlling terminal (and also
30+
to the child's standard input and output.
31+
\end{funcdesc}
32+
33+
\begin{funcdesc}{spawn}{argv\optional{, master_read\optional{, stdin_read}}}
34+
Spawn a process, and connect its controlling terminal with the current
35+
process's standard io. This is often used to baffle programs which
36+
insist on reading from the controlling terminal.
37+
38+
The functions \var{master_read} and \var{stdin_read} should be
39+
functions which read from a file-descriptor. The defaults try to read
40+
1024 bytes each time they are called.
41+
\end{funcdesc}

0 commit comments

Comments
 (0)