2 * atexit() example usage
8 static void my_exit1(void)
10 printf("first exit handler\n");
13 static void my_exit2(void)
15 printf("second exit handler\n");
20 if (atexit(my_exit2
) != 0)
21 fprintf(stderr
, "can't register my_exit2");
22 if (atexit(my_exit1
) != 0)
23 fprintf(stderr
, "can't register my_exit1");
24 if (atexit(my_exit1
) != 0)
25 fprintf(stderr
, "can't register my_exit1");
27 printf("main is done\n");