Question: - Project Linux C Program gcc file.c allocates shared memory, uses it then deallocates it Make sure there are no errors with allocation Read the

- Project

  • Linux C Program gcc

  • file.c allocates shared memory, uses it then deallocates it

  • Make sure there are no errors with allocation

  • Read the data from a file into shared memory

  • ex: file will contain one integer per line

  • file.c fork and exec one child

  • Have that child attach to shared memory and read the variable time(xx) given within file.c

  • Have the child output any the info into a file called log

  • This will have time of child,PID of child,Logical Process Id, and Lvl of tree aka where the child sits on the hierarchy

  • For parents output into a file called bin, it will include the # of children and lvl of tree aka where it sits on the hierarchy

  • Variables,x = number of child processes,xx = amount of time till termination in seconds

  • You cannot have more than 20 processes going at a time

  • Ctrl-C frees up shared mem, it also sends a kill signal for the children to terminate itself and prints a terminate message

  • The number of children by default is 20 which is put into x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!