Quickly answered. Thanks go to
Christophe Colle
The answer was to compile it with BSD defined, i.e. cc -D_BSD
Mike
I wrote:
>
> Hello Gurus,
>
> I tried searching the archive at Stanford for this but the search
> utility is currently down, so if this has been covered before, please
> forgive me.
>
> I am writing code for a process that will fork and I tried the following
> code for cleaning up zombie processes (found in Internetworking with
> TCP/IP by Comer & Stevens):
>
> #include <sys/types.h>
> #include <sys/resource.h>
> #include <sys/wait.h>
>
> /*----------------------------------------------------------------------*/
> /* reaper - clean up zombie children
> */
> /*----------------------------------------------------------------------*/
>
> int
> reaper()
> {
> union wait status;
>
> while (wait3(&status, WNOHANG, (struct rusage *)0) >= 0)
> /* empty */;
> }
>
> when compiling this code I get the following error:
>
> /usr/lib/cmplrs/cc/cfe: Error: TCPechod.c, line 100: storage size for
> 'status' isn't known
> union wait status;
> ---------- ^
>
> Now, if I add the union wait definition from <sys/wait.h> to my code it
> compiles fine. What gives?????
>
> Mike
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Michael R. Kline mike_at_lib.utexas.edu
> General Libraries Office: (512) 495-4391
> University of Texas at Austin FAX : (512) 495-4347
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Michael R. Kline mike_at_lib.utexas.edu
General Libraries Office: (512) 495-4391
University of Texas at Austin FAX : (512) 495-4347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Tue Mar 19 1996 - 17:34:02 NZST