•  Back 
  •  Process functions 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File5.12.48  Pwait3                                                    TOS

 Name:         »Pwait3« - Get exit code of any waiting or terminated 
               children of the calling process.

 Opcode:       284

 Syntax:       int32_t Pwait3 ( int16_t flag, int32_t *rusage );

 Description:  The function Pwait3 is equivalent to a call of Pwaitpid 
               (-1, flag, rusage) and determines with it the exit code 
               as well as the CPU load of a terminated or stopped 
               child process.

               flag is a bit-mask showing the specifics of this call 
               as follows:

                Value   Meaning

                1       If set, the function will not block the 
                        calling process if no child has been stopped 
                        or terminated, but will just return 0; if not 
                        set (clear), the process will be blocked until 
                        a child of the process has been terminated or 
                        stopped
                2       If set, returns exit codes for processes that 
                        have been terminated as well as stopped; if 
                        clear, only returns exit codes for processes 
                        that have actually terminated

               rusage points to an array of two LONGs that are filled 
               in with information about resource usage of the stopped 
               or terminated process. The first LONG holds the number 
               of milliseconds used by the child in user space; the 
               second LONG shows the number of milliseconds spent by 
               the process in kernel space. If this information is not 
               required, rusage may be set to NULL.

 Return value: The function can return the following results:

                >0    :  Exit status and PID of the child in the lower 
                         and upper 16 bits respectively of a 32-bit 
                         return code
                 0    :  No child processes have been stopped and/or 
                         terminated, or, if bit 0 of the parameter 
                         flag is set, the function would be blocked 
                         when waiting for the exit or the stopping of 
                         the child process
                EFILNF:  No child processes exist

 Availability: As of the first in MultiTOS integrated MiNT version 
               1.04, and MagiC as of Version 5.04.

 Group:        Process functions

 See Also:     Binding   Pwait   Pwaitpid