Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / IO::Pty.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "Pty 3"
132.TH Pty 3 "2002-04-02" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134IO::Pty \- Pseudo TTY object class
135.SH "VERSION"
136.IX Header "VERSION"
1371.02
138.SH "SYNOPSIS"
139.IX Header "SYNOPSIS"
140.Vb 1
141\& use IO::Pty;
142.Ve
143.PP
144.Vb 1
145\& $pty = new IO::Pty;
146.Ve
147.PP
148.Vb 1
149\& $slave = $pty->slave;
150.Ve
151.PP
152.Vb 5
153\& foreach $val (1..10) {
154\& print $pty "$val\en";
155\& $_ = <$slave>;
156\& print "$_";
157\& }
158.Ve
159.PP
160.Vb 1
161\& close($slave);
162.Ve
163.SH "DESCRIPTION"
164.IX Header "DESCRIPTION"
165\&\f(CW\*(C`IO::Pty\*(C'\fR provides an interface to allow the creation of a pseudo tty.
166.PP
167\&\f(CW\*(C`IO::Pty\*(C'\fR inherits from \f(CW\*(C`IO::Handle\*(C'\fR and so provide all the methods
168defined by the \f(CW\*(C`IO::Handle\*(C'\fR package.
169.PP
170Please note that pty creation is very system\-dependend. If you have
171problems, see IO::Tty for help.
172.SH "CONSTRUCTOR"
173.IX Header "CONSTRUCTOR"
174.IP "new" 3
175.IX Item "new"
176The \f(CW\*(C`new\*(C'\fR constructor takes no arguments and returns a new file
177object which is the master side of the pseudo tty.
178.SH "METHODS"
179.IX Header "METHODS"
180.IP "\fIttyname()\fR" 4
181.IX Item "ttyname()"
182Returns the name of the slave pseudo tty. On \s-1UNIX\s0 machines this will
183be the pathname of the device. Use this name for informational
184purpose only, to get a slave filehandle, use \fIslave()\fR.
185.IP "\fIslave()\fR" 4
186.IX Item "slave()"
187The \f(CW\*(C`slave\*(C'\fR method will return the slave filehandle of the given
188master pty, opening it anew if necessary. If IO::Stty is installed,
189you can then call \f(CW\*(C`$slave\->stty()\*(C'\fR to modify the terminal settings.
190.IP "\fIclose_slave()\fR" 4
191.IX Item "close_slave()"
192The slave filehandle will be closed and destroyed. This is necessary
193in the parent after forking to get rid of the open filehandle,
194otherwise the parent will not notice if the child exits. Subsequent
195calls of \f(CW\*(C`slave()\*(C'\fR will return a newly opened slave filehandle.
196.IP "\fImake_slave_controlling_terminal()\fR" 4
197.IX Item "make_slave_controlling_terminal()"
198This will set the slave filehandle as the controlling terminal of the
199current process, which will become a session leader, so this should
200only be called by a child process after a \fIfork()\fR, e.g. in the callback
201to \f(CW\*(C`sync_exec()\*(C'\fR (see Proc::SyncExec). See the \f(CW\*(C`try\*(C'\fR script
202(also \f(CW\*(C`test.pl\*(C'\fR) for an example how to correctly spawn a subprocess.
203.IP "\fIset_raw()\fR" 4
204.IX Item "set_raw()"
205Will set the pty to raw. Note that this is a one-way operation, you
206need IO::Stty to set the terminal settings to anything else.
207.Sp
208On some systems, the master pty is not a tty. This method checks for
209that and returns success anyway on such systems. Note that this
210method must be called on the slave, and probably should be called on
211the master, just to be sure, i.e.
212.Sp
213.Vb 2
214\& $pty->slave->set_raw();
215\& $pty->set_raw();
216.Ve
217.IP "clone_winsize_from(\e*FH)" 4
218.IX Item "clone_winsize_from(*FH)"
219Gets the terminal size from filehandle \s-1FH\s0 (which must be a terminal)
220and transfers it to the pty. Returns true on success and undef on
221failure. Note that this must be called upon the \fIslave\fR, i.e.
222.Sp
223.Vb 1
224\& $pty->slave->clone_winsize_from(\e*STDIN);
225.Ve
226.Sp
227On some systems, the master pty also isatty. I actually have no
228idea if setting terminal sizes there is passed through to the slave,
229so if this method is called for a master that is not a tty, it
230silently returns \s-1OK\s0.
231.Sp
232See the \f(CW\*(C`try\*(C'\fR script for example code how to propagate \s-1SIGWINCH\s0.
233.SH "SEE ALSO"
234.IX Header "SEE ALSO"
235IO::Tty, IO::Tty::Constant, IO::Handle, Expect, Proc::SyncExec
236.SH "MAILING LISTS"
237.IX Header "MAILING LISTS"
238As this module is mainly used by Expect, support for it is available
239via the two Expect mailing lists, expectperl-announce and
240expectperl\-discuss, at
241.PP
242.Vb 1
243\& http://lists.sourceforge.net/lists/listinfo/expectperl-announce
244.Ve
245.PP
246and
247.PP
248.Vb 1
249\& http://lists.sourceforge.net/lists/listinfo/expectperl-discuss
250.Ve
251.SH "AUTHORS"
252.IX Header "AUTHORS"
253Originally by Graham Barr <\fIgbarr@pobox.com\fR>, based on the
254Ptty module by Nick Ing-Simmons <\fInik@tiuk.ti.com\fR>.
255.PP
256Now maintained and heavily rewritten by Roland Giersig
257<\fIRGiersig@cpan.org\fR>.
258.PP
259Contains copyrighted stuff from openssh v3.0p1, authored by
260Tatu Ylonen <ylo@cs.hut.fi>, Markus Friedl and Todd C. Miller
261<Todd.Miller@courtesan.com>.
262.SH "COPYRIGHT"
263.IX Header "COPYRIGHT"
264Now all code is free software; you can redistribute it and/or modify
265it under the same terms as Perl itself.
266.PP
267Nevertheless the above \s-1AUTHORS\s0 retain their copyrights to the various
268parts and want to receive credit if their source code is used.
269See the source for details.
270.SH "DISCLAIMER"
271.IX Header "DISCLAIMER"
272\&\s-1THIS\s0 \s-1SOFTWARE\s0 \s-1IS\s0 \s-1PROVIDED\s0 ``\s-1AS\s0 \s-1IS\s0'' \s-1AND\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0
273\&\s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1BUT\s0 \s-1NOT\s0 \s-1LIMITED\s0 \s-1TO\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0
274\&\s-1MERCHANTABILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0 \s-1ARE\s0 \s-1DISCLAIMED\s0.
275\&\s-1IN\s0 \s-1NO\s0 \s-1EVENT\s0 \s-1SHALL\s0 \s-1THE\s0 \s-1AUTHORS\s0 \s-1BE\s0 \s-1LIABLE\s0 \s-1FOR\s0 \s-1ANY\s0 \s-1DIRECT\s0, \s-1INDIRECT\s0,
276\&\s-1INCIDENTAL\s0, \s-1SPECIAL\s0, \s-1EXEMPLARY\s0, \s-1OR\s0 \s-1CONSEQUENTIAL\s0 \s-1DAMAGES\s0 (\s-1INCLUDING\s0,
277\&\s-1BUT\s0 \s-1NOT\s0 \s-1LIMITED\s0 \s-1TO\s0, \s-1PROCUREMENT\s0 \s-1OF\s0 \s-1SUBSTITUTE\s0 \s-1GOODS\s0 \s-1OR\s0 \s-1SERVICES\s0; \s-1LOSS\s0
278\&\s-1OF\s0 \s-1USE\s0, \s-1DATA\s0, \s-1OR\s0 \s-1PROFITS\s0; \s-1OR\s0 \s-1BUSINESS\s0 \s-1INTERRUPTION\s0) \s-1HOWEVER\s0 \s-1CAUSED\s0 \s-1AND\s0
279\&\s-1ON\s0 \s-1ANY\s0 \s-1THEORY\s0 \s-1OF\s0 \s-1LIABILITY\s0, \s-1WHETHER\s0 \s-1IN\s0 \s-1CONTRACT\s0, \s-1STRICT\s0 \s-1LIABILITY\s0, \s-1OR\s0
280\&\s-1TORT\s0 (\s-1INCLUDING\s0 \s-1NEGLIGENCE\s0 \s-1OR\s0 \s-1OTHERWISE\s0) \s-1ARISING\s0 \s-1IN\s0 \s-1ANY\s0 \s-1WAY\s0 \s-1OUT\s0 \s-1OF\s0 \s-1THE\s0
281\&\s-1USE\s0 \s-1OF\s0 \s-1THIS\s0 \s-1SOFTWARE\s0, \s-1EVEN\s0 \s-1IF\s0 \s-1ADVISED\s0 \s-1OF\s0 \s-1THE\s0 \s-1POSSIBILITY\s0 \s-1OF\s0 \s-1SUCH\s0
282\&\s-1DAMAGE\s0.
283.PP
284In other words: Use at your own risk. Provided as is. Your mileage
285may vary. Read the source, Luke!
286.PP
287And finally, just to be sure:
288.PP
289Any Use of This Product, in Any Manner Whatsoever, Will Increase the
290Amount of Disorder in the Universe. Although No Liability Is Implied
291Herein, the Consumer Is Warned That This Process Will Ultimately Lead
292to the Heat Death of the Universe.