Add some missing libc functions: setenv, unsetenv, strdup.

--HG--
branch : dtrg-videocore
rename : lang/cem/libcc.ansi/stdlib/getenv.c => lang/cem/libcc.ansi/stdlib/setenv.c
rename : lang/cem/libcc.ansi/string/strlen.c => lang/cem/libcc.ansi/string/strdup.c
This commit is contained in:
David Given
2013-05-29 21:41:58 +01:00
parent 69953d016c
commit 074b42aa97
7 changed files with 162 additions and 28 deletions

View File

@@ -0,0 +1,17 @@
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
#include <string.h>
char*
strdup(const char *s)
{
int len = strlen(s);
char *p = malloc(len+1);
if (p)
memcpy(p, s, len+1);
return p;
}