It's a Operating System Projec Question

Question

NOTE: It's a Operating System Project so Please use the POSIX linux library and do it in C ProgrammingProject Question:1. You will implement two programs in this project that are closely related. The first program is calledALU. This program accepts three arguments from the command line. Two arguments are numberswhile one argument is one of the operations from ‘ ’, ‘-‘, ‘/’,’x’. Your main function should readthese arguments, if the number of arguments is not 3, then your program should return the value -9999and exit. If number of arguments is 3, then your program should perform the operation between thetwo numbers and return the result of the operation.2. The second program is called CPU. This program will take 1 argument from the command line whichwill be a filename. Your program should open this file and read mathematical operations from eachline. Each line of the file will have one number followed by an operation and then a second number. Asample file is given below.3 612 – 43 x 104 243. For each line in the file, your program should fork a child process, in the child process execute theprogram ALU and pass it the three values that you read from this line as arguments. Once all lineshave been executed, you will wait for the child ALU processes to finish execution and read the returnvalues sent by these processes. You will output the result of the operations in a file called math.txt inthe following format3 6 = 9Page 2 of 212 – 4 = 83 x 10 = 304 24 = not enough argumentsKeep in mind that an operation might produce a floating point exception. For example thefollowing is not possible mathematically6 / 0For operations like this, your program should report the following in the math.txt file6 / 0 = illegal operationYou should NOT check for the numbers to be zero. You should get the exit status from the “wait”call and check if the program

Details
Purchase An Answer Below

Have a similar question?