Gain Immediate access to our Essays
FREE access exchanged for your work, or pay £4.99
Words: | Submitted: Fri Mar 31 2006
... } } Function of the program The program will create a pipe and fork a child process, then use the child's output to the father's process input. Structure of the program 1. Firstly the program p2.c will create a pipe for interprocess communication; 2. Than it creates a child process; 3. The child prcess redirects its standard output (STDOUT) to the father's (original process) standard input (STDIN). 4. The function dup(), the STDIN of the father and STDOUT of the child have been reverse. They use pipe to connect in the process. 5. Then the child run the unix/linux command "ps -ef", it show all the running daemon; The output then send to the father's input; 6. The father then run the unix/linux command "grep httpd" to grab all the lines that containing the "httpd". 7. Finally, the father list out the result to the computer screen. Result The result listed out all the process is running and included the "httpd" Conclusion It ...
FREE access exchanged for your work, or pay £4.99