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
When entering a formula into a cell, you begin with are calculations a spreadsheet program applies to data. are preset calculati
Ugo [173]

Answer:

When entering a formula into a cell, you begin with  an equal sign

Functions and formulas are calculations a spreadsheet program applies to data.

Functions are preset calculations within spreadsheet software.

Formulas are user-entered calculations that may contain cell references, numerical values, and preset calculations.

Explanation:

I did the assignment on Edge 2020.

7 0
3 years ago
Of the following common metals which has the highest conductivity rating?
never [62]

Answer: D. Silver (happy to help)

Explanation:

3 0
3 years ago
Read 2 more answers
Several steps are involved in creating a presentation. what is the last step in the process before preparing to presenting it?
Softa [21]
D. Add designs and effects
6 0
3 years ago
Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
dusya [7]

Answer:

var movie = {

   // Code will be tested with different actors and movies

   name: "Interstellar",

   director: "Christopher Nolan",

   composer: "Hans Zimmer",

   cast: {

       "Matthew McConaughey": "Cooper",

       "Anne Hathaway": "Brand",

       "Jessica Chastain": "Murph",

       "Matt Damon": "Mann",

       "Mackenzie Foy": "Young Murph"

   },

   roleOf: function (actorName) {

       if (!(actorName in this.cast)) {

           return "Not in this movie.";

       }

       return this.cast[actorName];

   }

};

Explanation:

4 0
3 years ago
What are the text or graphics that are lighter than the main text located in a document's background called?
faust18 [17]
That would be a watermark
7 0
3 years ago
Other questions:
  • Thetremendous diversity of the source systems is the primary reasonfor their complexity. Do you agree
    6·1 answer
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • When setting up a file system that is intended to be shared among several users, it is good practice to configure permissions so
    5·1 answer
  • En su cuaderno o carpeta de trabajo realice la conversión del sistema de numeración binario a octal según este ejemplo de manera
    13·1 answer
  • when you type a day, month, or date, what features does Word use to automatically complete typing the day, month, or date for yo
    6·1 answer
  • Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any n
    8·1 answer
  • What tab on the ribbon do I go into to create new database objects in Access?
    13·1 answer
  • Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing li
    14·1 answer
  • What is the purpose of exploring data?
    6·2 answers
  • Define basic logical gates with its symbol, algebraic expression and truth table.​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!