* SUMMARY: trouble using wait3
@ 1996-03-19 15:57 Michael R. Kline
0 siblings, 0 replies; only message in thread
From: Michael R. Kline @ 1996-03-19 15:57 UTC (permalink / raw)
To: tru64-unix-managers
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@lib.utexas.edu
> General Libraries Office: (512) 495-4391
> University of Texas at Austin FAX : (512) 495-4347
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Michael R. Kline mike@lib.utexas.edu
General Libraries Office: (512) 495-4391
University of Texas at Austin FAX : (512) 495-4347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-03-19 15:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-19 15:57 SUMMARY: trouble using wait3 Michael R. Kline
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox