•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FilePwait()
Pexec()
Pterm()
Pterm0()
Ptermres()
Prusage()
Pwait3()                                                             GEMDOS

Syntax

LONG Pwait3( flag, rusage )
WORD flag;
LONG *rusage;

Function      Pwait3() determines the exit code of any children of the
              calling process which were stopped and/or terminated.

Opcode        284 (0x11C)

Availability  This function is available under all MiNT versions
              integrated with MultiTOS.

Parameters    flag is a bit mask which specifies the specifics of this
              call as follows:

              Name        Mask   Meaning

              PW_NOBLOCK  0x01   If set, the function will not block the
                                 calling process if no child has been
                                 stopped or terminated, rather it will
                                 simply return 0. If clear, the process
                                 will be blocked until a child of the
                                 process has terminated or is stopped.

              PW_STOPPED  0x02   If set, return exit codes for processes
                                 which have been terminated as well as
                                 stopped. If clear, only return exit codes
                                 for processes which have actually
                                 terminated.

              rusage points to an array of two LONGs which are filled in
              with resource usage information of the stopped or terminated
              process. The first LONG contains the number of milliseconds
              used by the child in user code. The second LONG indicates
              the number of milliseconds spent by the process in the
              kernel. rusage may be set to NULL if this information is
              undesired.

Binding       pea      rusage
              move.w   flag,-(sp)
              move.w   #11C,-(sp)
              trap     #1
              addq.l   #8,sp

Return Value  Pwait3() returns 0 if no child processes have been stopped
              and/or terminated (depending on flag) or a 32-bit return
              code for a child process which has been terminated or
              stopped. The process ID of the child process is placed in the
              upper 16 bits. A process which returned an exit status (via
              Pterm(), Ptermres(), or Pterm0() ) returns the exit code in
              the lower 16 bits. A process which was stopped as the result
              of a signal returns 0xnn7F where nn is the signal number
              which stopped it. A process which was terminated as the
              result of a signal returns 0xnn00 where nn is the signal
              number which killed the process.

See Also      Pwait(), Pexec(), Pterm(), Pterm0(), Ptermres(), Prusage()