1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marrrta [24]
3 years ago
8

Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Th

is zombie process must remain in the system for at least 10 seconds.
Computers and Technology
1 answer:
tankabanditka [31]3 years ago
5 0

Answer:

#include <stdlib.h>

#include <sys/types.h>

#include <unistd.h>

int main()

{

// Using fork() creates child process which is  identical to parent

int pid = fork();

 // Creating the Parent process

if (pid > 0)

 sleep(10);

// And then the Child process

else

{

 exit(0);

}

 

return 0;

}

Explanation:

Using a Text editor enter the code in the Answer section and save it as zombie.c. The created process will be able to run for 10 seconds.

Now open the Terminal and type $ cc zombie.c -o zombie to compile the program which is then saved as an executable file.

With a GNU compiler run the following command ./zombie which will give you an output of the parent process and child process to be used testing.

You might be interested in
Select four tasks associated with operating system maintenance. Cleaning inside the computer Defragmenting the hard drive Deleti
hram777 [196]

Answer:

Cleaning inside the computer

Defragmenting the hard drive

Deleting temporary files

Organizing data

Explanation:

7 0
2 years ago
PLEASE HELP WITH MY COMPUTER
qaws [65]

Answer:

try powering it off the turn it back on

Explanation:

5 0
3 years ago
Read 2 more answers
Two fingers are assigned to six letters each. What fingers are they?
Lena [83]

Answer:

The left and right index finger

Explanation:

Left index finger: R, T, F, G, C, V

Right index finger: Y, U, H, J, B, N

8 0
3 years ago
What is the importance of using the proper markup language?
Klio2033 [76]

the answer is D. without the right tags the content wont be accurately indexed

3 0
3 years ago
Read 2 more answers
Write six causes of data lost
just olya [345]
<span>1. Deleting files accidentally
</span>

2. Viruses and damaging malware

3. Mechanical damages of hard drive

4. Power failures

5. Theft of computer

6. Spilling coffee, and other water damages

7. Fire accidents and explosions

<span>Hope this helps.</span>
3 0
3 years ago
Other questions:
  • Which of following allows you to share a file with someone that is too large to send via e-mail?
    5·1 answer
  • The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
    9·1 answer
  • Cliff just started working with a client who has a very disorganized AdWords account. What’s an effective way for him to begin r
    15·1 answer
  • Lenovo's ThinkPad laptop computers is designed in the United States, the case, keyboard, and hard drive are made in Thailand; th
    14·1 answer
  • Which button will allow you to insert quotes and notes into text into a document​
    12·1 answer
  • Which of the following is the correct order of the SDLC?
    14·1 answer
  • List at least 4 types of works covered by copyright law
    5·1 answer
  • Which of the following Internet protocols is MOST important in reassembling packets and requesting missing packets to form compl
    11·1 answer
  • There are 55 registers, and total 60 instructions available in a general-purpose computer. The computer allows only 2-address in
    6·1 answer
  • Spreadsheets are sometimes credited with legitimizing the personal computer as a business tool. Why do you think they had such a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!