home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!destroyer!fmsrl7!ef2007!mjo
- From: mjo@ef2007.efhd.ford.com (Mike O'Connor)
- Subject: Re: Inhibiting core dumps on HP7xx
- Message-ID: <Brwwx9.CyL@ef2007.efhd.ford.com>
- X-Disclaimer: Not an official spokesperson for Ford OPEO
- Reply-To: Mike O'Connor <mjo@fmsrl7.srl.ford.com>
- Organization: International Affairs, Overseas Engineering, "Fordz"
- References: <1992Jul24.145006.20539@hubcap.clemson.edu> <7371168@hpfcso.FC.HP.COM>
- Date: Fri, 24 Jul 1992 21:27:09 GMT
- Lines: 73
-
- In article <7371168@hpfcso.FC.HP.COM> acmeyer@hpfcso.FC.HP.COM (Alan
- C. Meyer) writes:
-
- :In comp.sys.hp, elwin@gamma.phys.clemson.edu (Lawrence E. Brown) writes:
- :
- :> I'm very tired of frequent dumps of 10-40Meg core files every
- :> time I have a floating exception somewhere in my code (mostly
- :> Fortran some C). Is there any way to prevent core dumps in
- :> HPUX8.0x on an HP700 series machine?
- :
- :Here is some information if you are using a Fortran main program. By
- :default, trapping for floating point exceptions are not enabled. For
-
- Thank you for being informative and all... but this really doesn't
- answer the question. Under the underline is some code I have not
- tried out that claims it'll take care of HP core dumps.
-
- Will the ability to limit core dump sizes be present in HP-UX 9.0????
- Can someone from HP please comment?
-
-
- ------------------------------------------------------------------------
-
- I asked this question myself a few months back, and got a wonderful example
- program from hooft@prl.philips.nl showing that the BSD hooks are still
- in the HP-UX kernal. I ended up with a program called "nocore". I am in
- the process of trying to get this into the Interworks library, but since
- it is so short, I am appending it here.
-
- Good luck!
-
- Russell Randolph
- nCUBE, Beaverton, Oregon
- russell@ncube.com
-
- /* ------------------------------- nocore.c ------------------------------- */
- /* Prevents core dumps from whatever is run.
- * Tested on HP-UX 8.07 on 7xx series.
- * To compile: cc -o nocore -I/etc/conf/h -D_KERNEL nocore.c
- * Modified from example program by hooft@prl.philips.nl
- * Russell Randolph (russell@ncube.com)
- * Date: Thu Jul 16 1992
- */
-
- #include <stdio.h>
- #include <sys/resource.h>
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- struct rlimit rl;
-
- if (argc == 1) {
- fprintf(stderr,"Usage: nocore <programname> [arguements ...]\n");
- fprintf(stderr,"Example: nocore spice -b circuit.sp\n");
- fprintf(stderr,"Example: exec nocore $SHELL\n");
- fprintf(stderr,"Note: child processes will also have their core limits set to 0 bytes.\n");
- exit(1);
- }
- getrlimit(RLIMIT_CORE, &rl);
- rl.rlim_cur = 0;
- setrlimit(RLIMIT_CORE, &rl);
- *argv++;
- execvp(*argv,argv);
- fprintf(stderr,"Error: execvp of %s failed.\n", *argv);
- exit(1);
- }
- --
- Michael J. O'Connor | Internet: mjo@fmsrl7.srl.ford.com
- Ford Motor Company, OPEO | UUCP: ...!{backbone}!fmsrl7!mjo
- 20000 Rotunda, Bldg. 1-3001 | Phone: +1 (313) 248-1260
- Dearborn, MI 48121 | Fax: +1 (313) 323-6277
-