Listing 2

#include <stdio.h>
#include <signal.h>

#define RET_VALUE     0
#define TRUE 1

main(argc,argv)
int argc;
char **argv;     {
process(argc,argv);
exit(RET_VALUE);
}

process(argc,argv)
int argc;
char **argv;
{
int pid;
int status;
int ret;

signal(SIGINT,SIG_IGN);  /* Ignore interrupt key */
pid = fork();
if (pid == -1)
  {
  perror("all_true");
  exit(1);
  }

if (pid > 0 )
 {
 /* In parent */
 /* Wait for child */
 ret = wait(&status);
 if (ret == -1)
    perror("all_true");
 return;
 }

/* In child */
argv++;                  /* Point to program argument */
signal(SIGINT,SIG_DFL); /* Ignore interrupt key */
execvp(*argv, argv);
perror("all_true");
}


/* End of File */