Root/
Source at commit 1075 created 13 years 1 month ago. By meklort, Disk code | |
---|---|
1 | /*␊ |
2 | * onexit.c␊ |
3 | */␊ |
4 | ␊ |
5 | #include "libsaio.h"␊ |
6 | #include "atexit.h"␊ |
7 | ␊ |
8 | int on_exit(void (*fctn) (int, void *), void *arg)␊ |
9 | {␊ |
10 | ␉struct atexit *as = malloc(sizeof(struct atexit));␊ |
11 | ␊ |
12 | ␉if (!as)␊ |
13 | ␉␉return -1;␊ |
14 | ␊ |
15 | ␉as->fctn = fctn;␊ |
16 | ␉as->arg = arg;␊ |
17 | ␊ |
18 | ␉as->next = __atexit_list;␊ |
19 | ␉__atexit_list = as;␊ |
20 | ␊ |
21 | ␉return 0;␊ |
22 | }␊ |
23 |