summaryrefslogtreecommitdiff
path: root/src/Runtime/abort_exit.c
blob: 43b1a0c48e36fff33bbf3764b9702c6aa33b5c31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void __destroy_global_chain();

extern void (*_dtors[])(void);

int __aborting;


void exit(int state) {
	void (**dtor)(void);
	if (!__aborting) {
		dtor = _dtors;
		while (*dtor != 0) {
			(*dtor)();
			dtor++;
		}
	}
}