Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | |||
5 | int |
||
6 | atexit(void (*a)(void)) |
||
7 | { |
||
8 | struct __atexit *ap; |
||
9 | if (a == 0) |
||
10 | return -1; |
||
11 | ap = (struct __atexit *)malloc(sizeof(struct __atexit)); |
||
12 | if (!ap) |
||
13 | return -1; |
||
14 | ap->__next = __atexit_ptr; |
||
15 | ap->__function = a; |
||
16 | __atexit_ptr = ap; |
||
17 | return 0; |
||
18 | } |