DetachPids man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

Tcl_DetachPids(3)	    Tcl Library Procedures	     Tcl_DetachPids(3)


       Tcl_DetachPids, Tcl_ReapDetachedProcs - manage child processes in back‐

       #include <tcl.h>

       Tcl_DetachPids(numPids, pidPtr)


       int   numPids	  (in)	    Number of process  ids  contained  in  the
				    array pointed to by pidPtr.

       int   *pidPtr	  (in)	    Address   of   array   containing  numPids
				    process ids.

       Tcl_DetachPids and Tcl_ReapDetachedProcs provide a mechanism for manag‐
       ing  subprocesses that are running in background.  These procedures are
       needed because the parent of a process must eventually invoke the wait‐
       pid  kernel  call  (or one of a few other similar kernel calls) to wait
       for the child to exit.  Until the  parent  waits	 for  the  child,  the
       child's	state cannot be completely reclaimed by the system.  If a par‐
       ent continually creates children and doesn't wait on them, the system's
       process	table  will eventually overflow, even if all the children have

       Tcl_DetachPids may be called to ask Tcl to take responsibility for  one
       or  more	 processes whose process ids are contained in the pidPtr array
       passed as argument.  The caller presumably has started these  processes
       running in background and doesn't want to have to deal with them again.

       Tcl_ReapDetachedProcs  invokes  the  waitpid kernel call on each of the
       background processes so that its state can be  cleaned  up  if  it  has
       exited.	 If  the  process  hasn't  exited  yet,	 Tcl_ReapDetachedProcs
       doesn't wait for it to exit;  it will check again the next time	it  is
       invoked.	  Tcl  automatically calls Tcl_ReapDetachedProcs each time the
       exec command is executed, so in most cases it isn't necessary  for  any
       code  outside  of Tcl to invoke Tcl_ReapDetachedProcs.  However, if you
       call Tcl_DetachPids in situations where the exec command may never  get
       executed,  you may wish to call Tcl_ReapDetachedProcs from time to time
       so that background processes can be cleaned up.

       background, child, detach, process, wait

Tcl							     Tcl_DetachPids(3)

List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net