Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

system programing linux and unix !! explain this code ! 8.5 fork and standard I/O Consider this code: #include main() Programming Exercises 281 FILE p

system programing linux and unix !! explain this code !

image text in transcribed

8.5 fork and standard I/O Consider this code: #include main() Programming Exercises 281 FILE p int pid; char msg1[] = "Testing 1 2 3 .. "; char msg2 "Hello, helloln; if ( (fp= fopen ("testfile2 " , "w")) = NULL ) return 0 fprint f { fp, "%s ", msg1); if (pidfork))1 return 0 fprintf (fp, "s", msg2) fclose (fp) i return 1; Test this program. How many messages appear in the file? Explain the results. Compare this program to the output of forkdemol.c in the text 8.6 Background processing Compile and run this program: main() int i; if fork)0) Eor i-1i 10 i++ ) exit (0) printf ("still here. n" sleep(i) return 0 xplain what this program does and how it works. Unix shells allow users to run programs in the background. How is this program similar to a background process

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

1.The difference between climate and weather?

Answered: 1 week ago