Notes: Some code will be graded in this lab. The child process should not guess at the pipe file descriptor values. The parent process will get a random seed value from the command-line. The seed value will be passed to the "producer" process on its command-line. The "producer" process will generate a 2-digit random number. Each child process will send a digit to the parent as an exit-status. A log file is optional.Sample run is below. Debug output is shown so you can see some of the operations. A seed value of 325 was used. It generated a 2-digit random number of 84. It was split into digits 8 and 4. The 8 and 4 were collected by the parent as exit-codes. The 8 and 4 were then put back together as 84.$ ./lab14 325 Lab-14 is running for the parent... parent pipe fd: 3 4 producer pid: 2441289 execve for producer. consumer pid: 2441290 parent waitpid loop is starting... execve for consumer. Lab-14 is running for the producer. producer: random seed value: 325 producer random1: 84 producer half2: 4 producer writing to pipe. fd: 4 producer half1: 8 producer exiting. waitpid() producer exited. waitpid() producer number received: 8 Lab-14 is running for the consumer. consumer reading pipe. fd: 3 consumer read num: 4 consumer exiting. waitpid() consumer exited. waitpid() consumer number received: 4 numbers received: 8 4 number is: 84
To be collected...
3600/e/vrlab14.c