/*
 * crt0.c
 *
 * Copyright 2004, Minoru Murashima. All rights reserved.
 * Distributed under the terms of the BSD License.
 */


#include<stdlib.h>
#include<string.h>


char **environ;
static char empty[1];
char *__progname = empty;


extern int main(int argc,char **argv,char **envp);


void _start(int argc,char *argv[],char **envp)
{
	environ=envp;


	/* プログラム名の設定。 */
	if (argv[0])
	{
		if ((__progname = strrchr(argv[0], '/')) == NULL)
			__progname = argv[0];
		else ++__progname;
	}

	exit(main(argc,argv,envp));
}
