Changeset View
Changeset View
Standalone View
Standalone View
lib/csu/i386/crt1_c.c
Show All 28 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include "libc_private.h" | #include "libc_private.h" | ||||
#include "ignore_init.c" | #include "ignore_init.c" | ||||
typedef void (*fptr)(void); | |||||
extern void _start(char *, ...); | extern void _start(char *, ...); | ||||
#ifdef GCRT | #ifdef GCRT | ||||
extern void _mcleanup(void); | extern void _mcleanup(void); | ||||
extern void monstartup(void *, void *); | extern void monstartup(void *, void *); | ||||
extern int eprol; | extern int eprol; | ||||
extern int etext; | extern int etext; | ||||
#endif | #endif | ||||
void _start1(fptr, int, char *[]) __dead2; | void _start1(void (*)(void), int, char *[]) __dead2; | ||||
/* The entry function, C part. */ | /* The entry function, C part. */ | ||||
void | void | ||||
_start1(fptr cleanup, int argc, char *argv[]) | _start1(void (*cleanup)(void), int argc, char *argv[]) | ||||
{ | { | ||||
char **env; | char **env; | ||||
env = argv + argc + 1; | env = argv + argc + 1; | ||||
handle_argv(argc, argv, env); | handle_argv(argc, argv, env); | ||||
if (&_DYNAMIC != NULL) { | if (&_DYNAMIC != NULL) { | ||||
atexit(cleanup); | atexit(cleanup); | ||||
} else { | } else { | ||||
Show All 15 Lines |