return to UNIX

Write a program creating n child processes. Child processes are numbered i=(0..n-1). Child process selects random digit d=(0..9) and sends SIGRTMIN+i to parent process exactly d-times with 1ms break between signals.

Parent program counts receiving signals (each type separately) until any of child processes is alive. Prints results and exits.

Sample output for n = 3:

SIGRTMIN+0 -> 3
SIGRTMIN+1 -> 1
SIGRTMIN+2 -> 7

Program takes sole positive integer argument 32 > n > 0

This task will be graded by Marcin Borkowski, please submit your solutions to /home2/samba/borkowskim/unix/ folder.

Additional Remarks:

return to UNIX