Root/
Source at commit 1834 created 12 years 4 months ago. By blackosx, Fix (patch) building process. Resources now download and build successfully so package can be made. Checks are now needed to see if this works on different localizations and different systems. I have a feeling more work weill be needed to handle the unicodes etc. | |
---|---|
1 | /*␊ |
2 | * exit.c␊ |
3 | *␊ |
4 | * exit(), including the handling of the atexit chain.␊ |
5 | */␊ |
6 | ␊ |
7 | #include <stdlib.h>␊ |
8 | #include <unistd.h>␊ |
9 | #include <sys/syscall.h>␊ |
10 | #include "atexit.h"␊ |
11 | ␊ |
12 | /* Link chain for atexit/on_exit */␊ |
13 | struct atexit *__atexit_list;␊ |
14 | ␊ |
15 | void exit(int rv)␊ |
16 | {␊ |
17 | ␉struct atexit *ap;␊ |
18 | ␊ |
19 | ␉for (ap = __atexit_list; ap; ap = ap->next) {␊ |
20 | ␉␉/* This assumes extra args are harmless. They should␊ |
21 | ␉␉ be in all normal C ABIs, but if an architecture has␊ |
22 | ␉␉ some particularly bizarre ABI this might be worth␊ |
23 | ␉␉ watching out for. */␊ |
24 | ␉␉ap->fctn(rv, ap->arg);␊ |
25 | ␉}␊ |
26 | ␊ |
27 | ␉/* Handle any library destructors if we ever start using them... */␊ |
28 | ␊ |
29 | ␉_exit(rv);␊ |
30 | }␊ |
31 |