Disabling core dumps

dbj.rice%rand-relay at sri-unix.UUCP dbj.rice%rand-relay at sri-unix.UUCP
Thu Oct 27 12:08:43 AEST 1983


From:  Dave Johnson <dbj.rice at rand-relay>

On 4.1, the easiest way to disable core dumps is to use vlimit() to set the
maximum size of core dumps allowed to zero.  You can do this from the C
shell with the command

        limit coredumpsize 0

or from within the program with

        #include <sys/vlimit.h>
        vlimit(LIM_CORE, 0);

Once you do this, you will never see another core dump from this process or
any of its children.  You can undo this effect with either

        unlimit coredumpsize

from the shell, or

        vlimit(LIM_CORE, INFINITY);

from the program.  With the core dump disabled in this way, the shell still
prints the "Segmentation Fault" message, but, of course, doesn't add
"(core dumped)".

                                        Dave Johnson
                                        Dept. of Math Science
                                        Rice University
                                        dbj.rice at Rand-Relay



More information about the Comp.unix.wizards mailing list