diff options
Diffstat (limited to 'doc/GetStdChan.3')
-rw-r--r-- | doc/GetStdChan.3 | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/GetStdChan.3 b/doc/GetStdChan.3 index cf17650..8af1e7e 100644 --- a/doc/GetStdChan.3 +++ b/doc/GetStdChan.3 @@ -4,10 +4,8 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetStdChan.3,v 1.5 2004/10/07 14:44:32 dkf Exp $ -'\" -.so man.macros .TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures" +.so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -53,6 +51,18 @@ by calling \fBTcl_SetStdChannel\fR with a new channel or NULL in the \fBTcl_Close\fR, then the corresponding standard channel will automatically be set to NULL. .PP +If a non-NULL value for \fIchannel\fR is passed to \fBTcl_SetStdChannel\fR, +then that same value should be passed to \fBTcl_RegisterChannel\fR, like so: +.PP +.CS +Tcl_RegisterChannel(NULL, channel); +.CE +.PP +This is a workaround for a misfeature in \fBTcl_SetStdChannel\fR that it +fails to do some reference counting housekeeping. This misfeature cannot +be corrected without contradicting the assumptions of some existing +code that calls \fBTcl_SetStdChannel\fR. +.PP If \fBTcl_GetStdChannel\fR is called before \fBTcl_SetStdChannel\fR, Tcl will construct a new channel to wrap the appropriate platform-specific standard file handle. If \fBTcl_SetStdChannel\fR is called before @@ -67,8 +77,7 @@ assigned starting with standard input, followed by standard output, with standard error being last. .PP See \fBTcl_StandardChannels\fR for a general treatise about standard -channels and the behaviour of the Tcl library with regard to them. -.PP +channels and the behavior of the Tcl library with regard to them. .SH "SEE ALSO" Tcl_Close(3), Tcl_CreateChannel(3), Tcl_Main(3), tclsh(1) |