Homework 2: Using Unix System Services

This homework (Hints) is given October 3 and is due October 20 by 5pm.

This homework is just a vehicle for using a lot of Unix system services, thus becoming familiar with them. Look up the Stevens book and its code to see how these system services work.

Your program generates three children. Thus we have the following processes PARENT, CHILD1, CHILD2, and CHILD3.
Your program is called with as parameters the names of six text files, say, fn1, fn2, fn3, fn4, fn5, fn6.
Fn1 and fn2 already exist. Fn3 and fn4 are created by the second process (first child). Fn5 and fn6 are created by the third process (second child).

Define a function selfid that prints out the process id of the current process and of its parent.

PARENT:

CHILD1:

CHILD2:

CHILD3:

As comment in your program explain:

ingargiola@cis.temple.edu