1825719 Members
2962 Online
109686 Solutions
New Discussion

core files location

 
SOLVED
Go to solution
Fedele Giuseppe
Frequent Advisor

core files location

Hi all,

I need to set the path location in which a C process puts its core dump file.

Is there a way to do it (alternative to the standard cd in the wanted dir)?

Many thanks

Giuseppe
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: core files location

Hi Giuseppe:

You could call 'coreadm(2)' :

http://docs.hp.com/en/B2355-60130/coreadm.2.html

Regards!

...JRF...
Fedele Giuseppe
Frequent Advisor

Re: core files location

Many thanks,

can I use the call direclty in my process code, by providing mypid() as process pid?

Giuseppe
Dennis Handly
Acclaimed Contributor

Re: core files location

On 11.31, you can also use coreadm(1m) to redirect all corefiles.

>can I use the call directly in my process code,

Yes, using getpid(2).
Bill Hassell
Honored Contributor

Re: core files location

Yes, as long as you are running HP-UX 11.31. For all earlier versions of HP-UX, they will be stored in the current working directory. The only hidden core management feature for earlier versions of HP-UX is the ability to add the PID of the process to the core file name, as in core.1234 core.5678, etc

To setup this capability, you need to modify memory:

11.00 and 11i v1 (11.11)
echo â core_addpid/W 1â | adb â o â w /stand/vmunix /dev/kmem

11i v2 (11.23)
echo â core_addpid/W 1â | adb â k â w /stand/vmunix /dev/kmem

For 11.31, use the -g option to name the core files (there are many other options, read the man page).


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: core files location

Sorry about the MS Office junk characters -- here's the plain old ASCII version:

11.00 and 11i v1 (11.11)
echo "core_addpid/W 1" | adb -o -w /stand/vmunix /dev/kmem
11i v2 (11.23)
echo "core_addpid/W 1" | adb -k -w /stand/vmunix /dev/kmem


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: core files location

Hi (again):

> Bill: Sorry about the MS Office junk characters

Which is why I gave up keeping notes in MS Word and use only fixed-fonts in pure ASCII text files :-)

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: core files location

> JRF

I copy-pasted from a PowerPoint file -- duhhhh


Bill Hassell, sysadmin