TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrew Grillet
from: Rinat Sadretdinow
date: 1996-11-01 11:37:58
subject: core dump

Hello Andrew!

 AG> How do we get the system to do a core dump of the app automatically,
 AG> send a mesage an E-Mail/fidoMail reporting the problem, and KEEP ON
 AG> GOING without human intervention.

Try undocumented DosDumpProcess API, it generates file PDUMP.??? on the
root of the specified drive with a dump for certain application. Then you
may use PM Dump Facility to view the dump file. If you run OS/2 Version 4.0
than PMDF is located at \os2\pdpsi\pmdf, otherwise you should obtain it
somewhere else.

Here is an example:

-------------------------------8<------------------------------------
#define INCL_DOSPROCESS
#include 
#include 
#include 
#include 

#define DMP_OFF 0    // set default process dumping OFF
#define DMP_ON  1    // set default process dumping ON
#define DMP_PID 2    // dump process by pid

APIRET APIENTRY DosDumpProcess(ULONG ulFlag, ULONG ulDrive, ULONG ulPid);

main()
{
    APIRET rc;
    ULONG  ulDrive;
    PTIB   ptib;
    PPIB   ppib;

    DosGetInfoBlocks(&ptib, &ppib);

    printf("Enter drive letter to dump on: ");
    fflush(stdout);
    do
    {
        ulDrive = getch();
    } while (!isalpha(ulDrive));

    printf("%c:\n", ulDrive);

    printf("Dumping current process (pid: %d) on drive %c:...",
            ppib->pib_ulpid, ulDrive);
    fflush(stdout);

    if (!(rc = DosDumpProcess(DMP_PID, ulDrive, ppib->pib_ulpid)))
    {
        printf("done\n");

        printf("Dumping parent process (pid: %d) on drive %c:...",
                ppib->pib_ulppid, ulDrive);
        fflush(stdout);

        if (!(rc = DosDumpProcess(DMP_PID, ulDrive, ppib->pib_ulppid)))
        {
            printf("done\n");
        }
    }
    if (rc)
    {
        printf("DosDumpProcess reports an error %d\n", rc);
    }
    return 0;
}
-------------------------------8<------------------------------------

Bye!
Rinat Sadretdinow                                              [Team OS/2]

---
* Origin: -= Thunder Bird =- +7 095 947 1209 10:00pm-08:00am (2:5020/620)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 5020/620 509 443 79 5100/8 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.