From f9728e2abe7ef2a31d63dea36b5a14a6bba6e1db Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Tue, 3 Apr 2001 14:53:44 +0000 Subject: 2001-04-03 Andreas Kupries * unix/mkLinks: Added 'Signal.3', 'Tcl_WaitPid'. * doc/DetachPids.3: Added description of 'Tcl_WaitPid' [Bug #219173]. * doc/Signal.3: New man page describing the public API procedures 'Tcl_SignalId' and 'Tcl_SignalMsg' [Bug #219172]. --- ChangeLog | 9 +++++++++ doc/DetachPids.3 | 21 ++++++++++++++++++--- doc/Signal.3 | 38 ++++++++++++++++++++++++++++++++++++++ unix/mkLinks | 8 ++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 doc/Signal.3 diff --git a/ChangeLog b/ChangeLog index 61622e2..6b31157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-04-03 Andreas Kupries + + * unix/mkLinks: Added 'Signal.3', 'Tcl_WaitPid'. + + * doc/DetachPids.3: Added description of 'Tcl_WaitPid' [Bug #219173]. + + * doc/Signal.3: New man page describing the public API procedures + 'Tcl_SignalId' and 'Tcl_SignalMsg' [Bug #219172]. + 2001-04-02 Jeff Hobbs * README: diff --git a/doc/DetachPids.3 b/doc/DetachPids.3 index 23b16c5..818fb32 100644 --- a/doc/DetachPids.3 +++ b/doc/DetachPids.3 @@ -5,13 +5,13 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DetachPids.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ +'\" RCS: @(#) $Id: DetachPids.3,v 1.3 2001/04/03 14:53:45 andreas_kupries Exp $ '\" .so man.macros .TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures" .BS .SH NAME -Tcl_DetachPids, Tcl_ReapDetachedProcs \- manage child processes in background +Tcl_DetachPids, Tcl_ReapDetachedProcs, Tcl_WaitPid \- manage child processes in background .SH SYNOPSIS .nf \fB#include \fR @@ -19,14 +19,23 @@ Tcl_DetachPids, Tcl_ReapDetachedProcs \- manage child processes in background \fBTcl_DetachPids\fR(\fInumPids, pidPtr\fR) .sp \fBTcl_ReapDetachedProcs\fR() +.sp +Tcl_Pid +\fBTcl_WaitPid\fR(\fIpid, statPtr, options\fR) .SH ARGUMENTS .AS int *statusPtr .AP int numPids in Number of process ids contained in the array pointed to by \fIpidPtr\fR. .AP int *pidPtr in Address of array containing \fInumPids\fR process ids. +.AP Tcl_Pid pid in +The id of the process (pipe) to wait for. +.AP int* statPtr out +The result of waiting on a process (pipe). Either 0 or ECHILD. +.AP int options +The options controlling the wait. WNOHANG specifies not to wait when +checking the process. .BE - .SH DESCRIPTION .PP \fBTcl_DetachPids\fR and \fBTcl_ReapDetachedProcs\fR provide a @@ -57,6 +66,12 @@ However, if you call \fBTcl_DetachPids\fR in situations where the \fBexec\fR command may never get executed, you may wish to call \fBTcl_ReapDetachedProcs\fR from time to time so that background processes can be cleaned up. +.PP +\fBTcl_WaitPid\fR is a thin wrapper around the facilities provided by +the operating system to wait on the end of a spawned process and to +check a whether spawned process is still running. It is used by +\fBTcl_ReapDetachedProcs\fR and the channel system to portably access +the operating system. .SH KEYWORDS background, child, detach, process, wait diff --git a/doc/Signal.3 b/doc/Signal.3 new file mode 100644 index 0000000..b49dbe7 --- /dev/null +++ b/doc/Signal.3 @@ -0,0 +1,38 @@ +'\" +'\" Copyright (c) 2001 ActiveState Tool Corp. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: Signal.3,v 1.1 2001/04/03 14:53:45 andreas_kupries Exp $ +.so man.macros +.TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures" +.BS +.SH NAME +Tcl_SignalId, Tcl_SignalMsg \- Convert signal codes +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +char * +\fBTcl_SignalId\fR(\fIsig\fR) +.sp +char * +\fBTcl_SignalMsg\fR(\fIsig\fR) +.sp +.SH ARGUMENTS +.AP int sig in +A POSIX signal number such as \fBSIGPIPE\fR. +.BE + +.SH DESCRIPTION +.PP +\fBTcl_SignalId\fR and \fBTcl_SignalMsg\fR return a string +representation of the provided signal number (\fIsig\fR). +\fBTcl_SignalId\fR returns a machine-readable textual identifier such +as "SIGPIPE". \fBTcl_SignalMsg\fR returns a human-readable string such +as "bus error". The strings returned by these functions are +statically allocated and the caller must not free or modify them. + +.SH KEYWORDS +signals, signal numbers diff --git a/unix/mkLinks b/unix/mkLinks index 79dc91d..a5b4ed4 100644 --- a/unix/mkLinks +++ b/unix/mkLinks @@ -311,8 +311,10 @@ fi if test -r DetachPids.3; then rm -f Tcl_DetachPids.3 rm -f Tcl_ReapDetachedProcs.3 + rm -f Tcl_WaitPid.3 ln DetachPids.3 Tcl_DetachPids.3 ln DetachPids.3 Tcl_ReapDetachedProcs.3 + ln DetachPids.3 Tcl_WaitPid.3 fi if test -r DoOneEvent.3; then rm -f Tcl_DoOneEvent.3 @@ -760,6 +762,12 @@ if test -r SetErrno.3; then ln SetErrno.3 Tcl_ErrnoId.3 ln SetErrno.3 Tcl_ErrnoMsg.3 fi +if test -r Signal.3; then + rm -f Tcl_SignalId.3 + rm -f Tcl_SignalMsg.3 + ln Signal.3 Tcl_SignalId.3 + ln Signal.3 Tcl_SignalMsg.3 +fi if test -r SetRecLmt.3; then rm -f Tcl_SetRecursionLimit.3 ln SetRecLmt.3 Tcl_SetRecursionLimit.3 -- cgit v0.12