the argv's value had been changed. the result was displaying "child fork error : no child process".
the function tokenize gets command(which is a variable named buffer) and arguments(defined char **argv). then argv will be set with strings that i entered which were argv[0] = "/bin/ls" argv[1] = "ls" argv[2]=NULL
i have checked it displayed the data as it should be when i put an code line before fork().
and also i tried with this code, setting the data by hardcoding.
switch(pid = fork())
{
case -1:
perror(.........);
exit(1);
break;