restore the enviornment test

This commit is contained in:
Stefan Lankes 2011-09-19 10:09:00 +02:00
parent 65d4cbe76d
commit ada25a756a

View file

@ -44,8 +44,19 @@ extern int errno;
int main(int argc, char** argv)
{
char* teststr = malloc(sizeof(char)*100);
int testfile = open("/bin/test.txt", O_CREAT | O_EXCL, "wr");
int i, testfile;
char* teststr;
for(i=0; environ[i]; i++)
printf("environ[%d] = %s\n", i, environ[i]);
for(i=0; i<argc; i++)
printf("argv[%d] = %s\n", i, argv[i]);
teststr = malloc(sizeof(char)*100);
if (!teststr)
return EFAULT;
testfile = open("/bin/test.txt", O_CREAT | O_EXCL, "wr");
write(testfile, "hello in new file '/bin/test.txt'", 34);
lseek(testfile, 0, SEEK_SET);
read(testfile, teststr, 100);