two questions

hey all, I have question when am writing simple shell...

in the child am calling execvp, i want the parent to know when execvp returns - 1. how can i let the parent know the result of execvp

thanks in advance

Moved to High Level Programming.
If it's really shell and not C, let me know and I will move the threat back to Shell Programming.

The code is being wrriten in c.

OK,
so this is the right forum.

call waitpid() in the parent using the pid of the child. Call exit(-1) from the child.
There are macros in sys/wait.h like WIFEXITED() that you use to evaluate the return status code from the child in the parent.

Is that what you mean? See Johnson & Troan 'Linux Application Development' They develop a shell step-by-step. See the ladsh1.c examples here:
Linux Application Development: Source Code

.........

Did you:

#include <sys/types.h>
#include <sys/wait.h>

...at the top of your code? waitpid needs both.

thanks alot man..appreciated.

I forgo to put the second question..

ctrl c is for SIGINT
Anyone knows whats ctrl d ??

More precisely, ctrl-c causes the shell to send sigint. And ctrl-D causes EOF -- the shell closes its own end of the pipe feeding into the process' standard input. The process will see there's no more data to read and quit instead of waiting forever on a pipe.

Each signal has a numeric value and a "name"

kill -l

-- that is a lowercase ELL character not a one in the -l.
This lists the names of each signal and it's value for your system.