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
// PrintStrings // Traverse the 2D character array "strings" and print each of the contained strings.// See the example outputs
anzhelika [568]

Answer:

C++.

Explanation:

void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) {

   // Multi dimension array can be traversed through multi-level loops

   for (int i = 0; i < NUM_STRINGS; i++) {

       for (int j = 0; j < STRING_LENGTH; j++) {

           cout<<"<<strings[i][j]<<";

       }

       cout<<endl;

   }

}

Output would be like this, depending on the size of NUM_STRINGS;

"One"

"Two"

"Three"

....

6 0
3 years ago
Part 1 of 4 parts for this set of problems: Given an 4777 byte IP datagram (including IP header and IP data, no options) which i
LekaFEV [45]

Answer:

Fragment 1: size (1332), offset value (0), flag (1)

Fragment 2: size (1332), offset value (164), flag (1)

Fragment 3: size (1332), offset value (328), flag (1)

Fragment 4: size (781), offset value (492), flag (1)

Explanation:

The maximum = 1333 B

the datagram contains a header of 20 bytes and a payload of 8 bits( that is 1 byte)

The data allowed = 1333 - 20 - 1 = 1312 B

The segment also has a header of 20 bytes

the data size = 4777 -20 = 4757 B

Therefore, the total datagram = 4757 / 1312 = 4

6 0
2 years ago
What do newly PivotTables look like?
adell [148]

Answer:

Answer is in attached image!

Explanation:

8 0
2 years ago
JAVA
Umnica [9.8K]

import java.util.Scanner;

public class JavaApplication58 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a positive integer:");

       String num = scan.nextLine();

       for (int i = num.length()-1; i >=0; i--){

           System.out.println(num.charAt(i));

       }

       

   }

   

}

I hope this helps!

5 0
3 years ago
What symbol do we use to denote a character?
pychu [463]

Answer:

'Single Character'

Explanation:

A Character, commonly abbreviated as "char", is a computer symbol, letter, or number. A keyboard is an input device that inputs a character when a key is pressed.

5 0
2 years ago
Other questions:
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • What are the problems with security when working on a Web Page?
    13·2 answers
  • An identifying value called a/an ____ is assigned by the java runtime to an object when it is created, to allow the java runtime
    14·1 answer
  • Which agency coordinate the Internet's IP addressing and DNS system.
    15·1 answer
  • Which window allows you to view and change your computer's system information and settings?
    9·2 answers
  • Is there a way to earn free robux
    7·2 answers
  • Who Likes K-pop? Which group or groups do you like
    12·2 answers
  • Explain briefly why it is sometimes necessary to roll software back to a previous version, a procedure called "software
    9·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
  • What was revolutionary about Web 2.0?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!