1. Develop a program to do the follows. (40pts) a) Create a pipe. b) Fork() a child process. c) Let the parent process w
Posted: Fri May 20, 2022 3:00 pm
1. Develop a program to do the follows. (40pts) a) Create a
pipe. b) Fork() a child process. c) Let the parent process write 20
integers between [1, 50] to the pipe. Use random() function to
generate the integers. d) Let the child process read the 20
integers from the pipe and write them to a message queue. Let the
child process create the message queue, and then do the writing.
Assign type 1 to odd integer, and assign type 2 to even integer
when writing them to the message queue.
Subject: Systems Programming
pipe. b) Fork() a child process. c) Let the parent process write 20
integers between [1, 50] to the pipe. Use random() function to
generate the integers. d) Let the child process read the 20
integers from the pipe and write them to a message queue. Let the
child process create the message queue, and then do the writing.
Assign type 1 to odd integer, and assign type 2 to even integer
when writing them to the message queue.
Subject: Systems Programming