Find the answer to your Linux question:
Results 1 to 2 of 2
SOMEBODY PLEASEE HELPS ME... You are expected to implement a C program that uses fork and exec calls. The design steps will be as follows:1) The parent process will fork ...
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    1

    Homework about fork parents and childs

    SOMEBODY PLEASEE HELPS ME...
    You are expected to implement a C program that uses fork and exec calls. The design steps will be as follows:1) The parent process will fork 2 children processes. No Child process will create another one. 2) The first child will print the numbers from 0 to 9, into a text file, once a second. After printing 9, it will quit. This process will not print the numbers to the screen. 3) The second child will execute a program to simultaneously follow the text file's contents. That is, whenever a number is printed into the file, this second child will print it out to screen. The command that should be executed can be, "tail -f textfile". But remember, this child will not terminate itself.4) At the same time, the parent process will be waiting for one child to exit. After it is notified of a child death, it will kill all occurences of the "tail" program. This can be achieved by executing "killall tail" command.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    As per the forum rules, homework questions are not allowed.

    If you have a question about a specific concept or why something that you've written does not work, please feel free to ask it. But don't expect us to do your homework for you.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...