#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <libp.h>

char **_environ;

#pragma startup envset 19

static void envset(void)
{
	int count = _ll_getenv(0,0),i;
	if (count) {
		_environ  = malloc(sizeof(char *)*(count+1));
	  for (i=1; i<=count; i++) {
			char buf[1024];
			_ll_getenv(buf,i);
		  _environ[i-1] = strdup(buf) ;
		}
		_environ[count] = 0;
	}
	else {
		_environ = calloc(sizeof(char *),1);
	}
}