Home

WCOREDUMPstatus

WCOREDUMPstatus is a term used to describe the interpretation of a process’s termination status with respect to core dumps in Unix-like systems. It centers on the WCOREDUMP macro, defined in sys/wait.h, which tests whether the status value returned by wait or waitpid indicates that a core file was created. Together with other status macros, WCOREDUMPstatus helps determine not only that a process ended abnormally, but whether a core dump was produced for debugging.

How it is used: after a waitpid call returns a status, the macro WIFSIGNALED(status) checks if the

Implementation notes: WCOREDUMP is portable across many Unix-like systems that provide the standard wait status macros,

See also:

- waitpid

- WIFSIGNALED

- WCOREDUMP

- WTERMSIG

- core_pattern

- ulimit -c

child
was
terminated
by
a
signal.
If
true,
WCOREDUMP(status)
will
be
nonzero
if
a
core
dump
occurred.
If
a
core
dump
was
produced,
you
can
handle
it
accordingly;
if
not,
you
can
report
the
terminating
signal
via
WTERMSIG(status).
Note
that
WCOREDUMP
is
meaningful
primarily
for
signaled
terminations
and
may
be
false
if
core
dumps
are
disabled
or
the
kernel
did
not
generate
one.
but
exact
behavior
can
vary
by
platform.
On
Linux,
core
dumps
are
controlled
by
user
limits
(ulimit
-c)
and
by
the
kernel's
core_pattern
setting,
which
determine
whether
a
core
file
is
created
and
where
it
is
written.
In
practice,
WCOREDUMP(status)
assists
debuggers
and
system
tools
in
distinguishing
crashes
that
produce
core
files
from
those
that
do
not.