예제 #1
0
파일: ignore_init.c 프로젝트: Zeke-OS/zeke
static inline void
handle_static_init(int argc, char ** argv, char ** env)
{
    size_t array_size;

#if 0
    if (&_DYNAMIC != NULL)
        return;
#endif

    __init_stdio();

    atexit(finalizer);

    array_size = __preinit_array_end - __preinit_array_start;
    for (size_t n = 0; n < array_size; n++) {
        void (*fn)(int, char **, char **);

        fn = __preinit_array_start[n];
        if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1)
            fn(argc, argv, env);
    }

    array_size = __init_array_end - __init_array_start;
    for (size_t n = 0; n < array_size; n++) {
        void (*fn)(int, char **, char **);

        fn = __init_array_start[n];
        if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1)
            fn(argc, argv, env);
    }
}
예제 #2
0
파일: main.cpp 프로젝트: besiano15/ghost
/**
 * Initializes the C library
 */
void __g_init_libc() {

	// set default locale (N1548-7.11.1.1-4)
	setlocale(LC_ALL, "C");

	// set default signal handlers
	signal(SIGINT, SIG_DFL);

	// initialize standard I/O
	__init_stdio();
}