Re: [PATCH v4] abort: clarify consequences of calling abort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

attached is a small test program. Compile simply with:

    $ gcc atexit.c -o atexit

When running the test I get:

    $ ./atexit 
    terminating
    on_exit called
    atexit called

When the abort() call is uncommented I get:

    $ ./atexit 
    terminating
    Aborted (core dumped)

Hope this helps,

    Tomas
#define _DEFAULT_SOURCE

#include <stdio.h>
#include <stdlib.h>

void one(void) {
    puts("atexit called");
}

void two(int, void*) {
    puts("on_exit called");
}

int main(void) {
    atexit(one);
    on_exit(two, NULL);

    puts("terminating");
    //abort();
    exit (EXIT_SUCCESS);
}

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux