Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/modules/klibc/exit.c

Source at commit 728 created 13 years 3 months ago.
By meklort, Updated Symbols.dylib generation. Module linked list rework beginning. USB Legacy off patch still needs fixing. Added a new tool to generate the symbols.dylib. It's a fairly correct dylib file, however nm complains about it (it still works fine though). Updated Symbols.dylib file is smaller (~13%) that the old method and is a bit cleaner. dylib generation needs a bit of cleaning up though)
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 */
13struct atexit *__atexit_list;
14
15void exit(int rv)
16{
17struct atexit *ap;
18
19for (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. */
24ap->fctn(rv, ap->arg);
25}
26
27/* Handle any library destructors if we ever start using them... */
28
29_exit(rv);
30}
31

Archive Download this file

Revision: 728