#include <stdlib.h>
#include <stdio.h>
void before_exit(int status,void *arg)
{
    printf("before exit()!\n");
    printf("exit_status= %d,arg=%s\n",status,(char*)arg);
} 

void test_at()
{
	printf("I am atexit().\n");
}
int main()
{
    char * str="on_exit";
//	atexit(test_at);
    on_exit(before_exit,(void *)str);
    exit(1111);
}
