core files under SV
Conor P. Cahill
cpcahil at virtech.uucp
Thu Nov 16 03:12:41 AEST 1989
In article <MRD.89Nov15011304 at image.clarkson.edu>, mrd at sun.soe.clarkson.edu (Michael DeCorte) writes:
>
> There has got to be a little function I can call that will generate a
> core file of my process but I sure can't find it in sections 2 or 3.
> Anybody know what it is?
>
> NOTE I want to generate a core file but NOT exit. Yup I just want to
> go along on my merry way.
There is no system or library call to do this, but you could just do
the following:
if( fork() == 0 )
{
abort();
}
which will result in a core file being generated and letting your
current program continue executing. If you do this alot, without performing
a wait(2), you will eventually run out of process table slots. So either
do a wait() after the fork(), or limit the number of times you do this.
--
+-----------------------------------------------------------------------+
| Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 !
| Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 |
+-----------------------------------------------------------------------+
More information about the Comp.unix.questions
mailing list