144922Smckusick /* 244922Smckusick * Copyright (c) 1989 Jan-Simon Pendry 344922Smckusick * Copyright (c) 1989 Imperial College of Science, Technology & Medicine 4*61794Sbostic * Copyright (c) 1989, 1993 5*61794Sbostic * The Regents of the University of California. All rights reserved. 644922Smckusick * 744922Smckusick * This code is derived from software contributed to Berkeley by 844922Smckusick * Jan-Simon Pendry at Imperial College, London. 944922Smckusick * 1044922Smckusick * %sccs.include.redist.c% 1144922Smckusick * 12*61794Sbostic * @(#)uwait.h 8.1 (Berkeley) 06/06/93 1349688Spendry * 1452456Spendry * $Id: uwait.h,v 5.2.2.1 1992/02/09 15:10:01 jsp beta $ 1549688Spendry * 1644922Smckusick */ 1744922Smckusick 1847527Spendry #if defined(mc68k) || defined(mc68000) || defined(mc68020) || defined(sparc) || defined(hp9000s300) || defined(hp9000s800) 1944922Smckusick #define BITS_BIGENDIAN 2044922Smckusick #endif 2144922Smckusick #if defined(vax) || defined(i386) 2244922Smckusick #define BITS_LITTLENDIAN 2344922Smckusick #endif 2444922Smckusick #if !defined BITS_BIGENDIAN && !defined BITS_LITTLENDIAN 2544922Smckusick #error Do not know my byte ordering 2644922Smckusick #endif 2744922Smckusick 2844922Smckusick /* 2944922Smckusick * Structure of the information in the first word returned by both 3044922Smckusick * wait and wait3. If w_stopval==WSTOPPED, then the second structure 3144922Smckusick * describes the information returned, else the first. See WUNTRACED below. 3244922Smckusick */ 3344922Smckusick union wait { 3444922Smckusick int w_status; /* used in syscall */ 3544922Smckusick /* 3644922Smckusick * Terminated process status. 3744922Smckusick */ 3844922Smckusick struct { 3944922Smckusick #ifdef BITS_LITTLENDIAN 4044922Smckusick unsigned short w_Termsig:7; /* termination signal */ 4144922Smckusick unsigned short w_Coredump:1; /* core dump indicator */ 4244922Smckusick unsigned short w_Retcode:8; /* exit code if w_termsig==0 */ 4344922Smckusick #endif 4444922Smckusick #ifdef BITS_BIGENDIAN 4544922Smckusick unsigned short w_Fill1:16; /* high 16 bits unused */ 4644922Smckusick unsigned short w_Retcode:8; /* exit code if w_termsig==0 */ 4744922Smckusick unsigned short w_Coredump:1; /* core dump indicator */ 4844922Smckusick unsigned short w_Termsig:7; /* termination signal */ 4944922Smckusick #endif 5044922Smckusick } w_U; 5144922Smckusick }; 5244922Smckusick #define w_termsig w_U.w_Termsig 5344922Smckusick #define w_coredump w_U.w_Coredump 5444922Smckusick #define w_retcode w_U.w_Retcode 5544922Smckusick 5644922Smckusick #define WIFSIGNALED(x) ((x).w_termsig != 0) 5744922Smckusick #define WIFEXITED(x) ((x).w_termsig == 0) 58