Write the output of the following C program that uses process system calls int main(void) {...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the output of the following C program that uses process system calls int main(void) { } int pid, status, lcm=0; pid= fork(); if (pid=-1){ printf("error"); exit(1); } if (pid=0){ execl("./a.out","a.out","35","23","32",(char*)NULL); //a.out is an executable file which does LCM of the numbers given as arguments and prints on screen printf("Product of Numbers: %f\n",lcm), } else printf("status = %d\n",status); wait(&status); Write the output of the following C program that uses process system calls int main(void) { } int pid, status, lcm=0; pid= fork(); if (pid=-1){ printf("error"); exit(1); } if (pid=0){ execl("./a.out","a.out","35","23","32",(char*)NULL); //a.out is an executable file which does LCM of the numbers given as arguments and prints on screen printf("Product of Numbers: %f\n",lcm), } else printf("status = %d\n",status); wait(&status);
Expert Answer:
Answer rating: 100% (QA)
The output of the program will be status 0 Product of Numbers 1071... View the full answer
Related Book For
Operating Systems Design And Implementation
ISBN: 9780131429383
3rd Edition
Authors: Andrew Tanenbaum, Albert Woodhull
Posted Date:
Students also viewed these computer network questions
-
The following information is for Winnie Company. Product A: Revenue Variable Cost Product B: Revenue Variable Cost Total fixed costs are $4.00 $1.00 $6.00 $2.00 $40,000 What is the break-even point...
-
What algorithms do operating systems use to allocate CPU time, memory, and other resources among competing processes, and how do these algorithms balance fairness and efficiency ?
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
What type of motor would you specify for a meat grinder if the motor is to be exposed?
-
In 2013, Choctaw Company implements a new process affecting labor and materials. The following reported data are provided to evaluate the effect on the company's productivity: 2012 2013 Number of...
-
Which of the following does a forensic accountant investigate? (a) Purchases of Businesses (b) Valuation of divorce assets (c) Calculation of lost profits (d) All of the above
-
At May 31, 2002, the accounts of Corrales Manufacturing Company show the fol- lowing. 1. May 1 inventories finished goods \($12,600\), work in process \($14,700\), and raw materials $8,200. 2. May 31...
-
The Piedmont School of Music has hired you as a consultant to help in analyzing the behavior of the schools costs. Use the account-classification method of cost estimation to classify each of the...
-
Answer the following questions about the cotangent function. a) Is the cotangent function even, odd, or neither? h) Is the graph of the cotangent function symmetric? With respect to what?
-
You want to purchase a home based upon your current salary you decide that you can afford $2000.00 per month. Your bank has approved you for a (30 year) loan at an interest rate of 5%. 1) Based upon...
-
You have just purchased your Audi and taken out a $50,000 loan. The loan has afive-year term with monthly payments and an APR of 6.0% (with monthlycompounding). a. How much will you pay ininterest,...
-
Consider an object in straight line motion with a(t)=21-11 where v(2)=-30 feet per second and s(0)=5 feet with 10. a) Find the formula for v(t). b) Find the formula for s(t).
-
Multiply the numbers. Write your answer in simplest form. x -
-
2) A 1.2 m long beam is free to rotate about its left end. What force F must be applied in order to achieve rotational equilibrium? -1.2 m -0.5 m <0.25m F = ? 320 N 980 N 3) A uniform beam with a...
-
Use implicit differentiation to find dy/dx. Then find the slope of the curve at the given point. dx 3xy - 8x + y = 41; 14
-
A restaurant purchased kitchen equipment on January 1, 2017. On January 1, 2019, the value of the equipment was $14,600. The value after that date was modeled -0.1511 as follows. V(t)=14,600 a) What...
-
.......... Question 2 (Total 25 marks) New Orders Ltd (NOL) is a retailer of electronics appliances operating in Hong Kong. During its financial year ended 28 February 2021 (with issue date on 5...
-
Why is a help desk and production support critical to system implementations? Discuss its interrelationship with the problem management and reporting system.
-
Why is the chroot system call limited to the superuser?
-
How could an operating system that can disable interrupts implement semaphores?
-
Show if setting the (now-unused) ROBUST flag might make the file system more or less robust in the face of a crash. Whether this is the case in the current version of MINIX 3 has not been researched,...
-
Assume that interest rate parity exists and it will continue to exist in the future. Assume that interest rates of the United States and the United Kingdom vary substantially in many periods. You...
-
Assume that interest rate parity exists and it will continue to exist in the future. Kentucky Co. wants to forecast the value of the Japanese yen in 1 month. The Japanese interest rate is lower than...
-
Assume that interest rate parity exists. Today the 1-year U.S. interest rate is equal to 8 percent, while Mexicos 1-year interest rate is equal to 10 percent. Today the 2- year annualized U.S....
Study smarter with the SolutionInn App