StudyingUnixInterface/7/pcs/exit.c
2020-12-13 10:37:27 +08:00

18 lines
284 B
C

#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
void func(void) {
printf("calling func\n");
}
int main(void) {
printf("ATEXIT_MAX: %ld\n", sysconf(_SC_ATEXIT_MAX));
if(atexit(func)) {
printf("atexit error\n");
exit(-1);
}
exit(0);
}