here is the code. please go through it and reply with comments. #include #include #include #include void cvs_process_open (void) { int my_read[2]; int my_write[2]; int cvs_process_my_read; int cvs_process_my_write; int cvs_process_his_read; int cvs_process_his_write; int data_processed; char **args = NULL; char buffer[11]; pid_t pID; args = (char **)malloc(sizeof(char *) * 6); if(NULL == args) { printf("unable to allocate mem\n"); exit(1); }/* if(NULL == args) */ args[0] = (char *)strdup("cvs"); args[1] = (char *)strdup("-d"); args[2] = (char *)strdup(":pserver:mehul@192.168.0.35:/home/cvs/repository"); args[3] = (char *)strdup("-q"); args[4] = (char *)strdup("login"); args[5] = (char *)NULL; /* Open two pipes. (Bidirectional communication). */ if ((pipe (my_read) == -1) || (pipe (my_write) == -1)) { fprintf(stderr, "unable to open pipe\n"); exit(1); }/* if ((pipe (my_read) == -1) || (pipe (my_write) == -1)) */ cvs_process_my_read = my_read[0]; cvs_process_my_write = my_write[1]; cvs_process_his_read = my_write[0]; cvs_process_his_write = my_read[1]; /* Fork another process. We'll remember the process id * so that we can later use it to kill the filter if * necessary. */ pID= fork (); if (pID == 0) { /* close(cvs_process_my_read); close(cvs_process_my_write); */ /* Execute the filter. The "_exit" call should never * be reached, unless some strange error condition * exists. */ data_processed = read(my_write[0], buffer, 10); printf("(child) data_processed = %d buffer = %s err = %s\n", data_processed, buffer, strerror(errno)); execvp (args[0], args); _exit (1); }/* if (pID == 0) */ else if (pID == -1) { // fork failed exit(1); }/* else for else if (pID == -1) */ data_processed = write(my_write[1], "*mrc-mrc_*", strlen("*mrc-mrc_*")); printf("data_processed = %d err = %s\n", data_processed, strerror(errno)); close(cvs_process_his_read); cvs_process_his_read = -1; close(cvs_process_his_write); cvs_process_his_write = -1; }/* cvs_process_open() */ int main(int argc, char *argv[]) { cvs_process_open(); return 0; }/* main() */