case 'e': /* take wait before parent exit */
wait_end = strtol(optarg, NULL, 10); /* convert input */
break;
case 'e': /* take wait before parent exit */
wait_end = strtol(optarg, NULL, 10); /* convert input */
break;
case '?': /* unrecognized options */
printf("Unrecognized options -%c\n",optopt);
usage();
case '?': /* unrecognized options */
printf("Unrecognized options -%c\n",optopt);
usage();
printf("Usage:\n");
printf(" forktest [-h] [-p sec] [-c sec] [-e sec] child to fork \n");
printf(" -h print this help\n");
printf("Usage:\n");
printf(" forktest [-h] [-p sec] [-c sec] [-e sec] child to fork \n");
printf(" -h print this help\n");
printf(" -p sec wait sec seconds before next fork\n");
printf(" -c sec wait sec seconds before child termination\n");
printf(" -e sec wait sec seconds before parent return\n");
printf(" -p sec wait sec seconds before next fork\n");
printf(" -c sec wait sec seconds before child termination\n");
printf(" -e sec wait sec seconds before parent return\n");