1. Carefully study the examples described in class: fork.c, myls.c, myshell.c, etc.. You need to know how they work in order for you to finish this assignment; the examples will also get you prepared for major assignment 3.
2. Write a program that creates two child processes: one to execute ‘ls’ and the other to execute ‘sort’. After the forks, the original parent process waits for both child processes to finish before it terminates. The standard output of ‘ls’ process should be piped to the input to the ‘sort’ process. Make sure you close the unnecessary open files for the three processes.
Please follow the following instructions carefully before submitting your work:
* Create a directory for this homework, call it ‘firstname-lastname-offhand-3’. Under this directory, you put your source code and the Makefile.
* You need to create a Makefile to build your source code into an executable. The Makefile should also include a target ‘clean’ to clean up miscellaneous files (*.o, the executable file, *~, core, etc.). Before submission, make sure you clean up the directories so that no miscellaneous files are kept around in the submission. (Grade would be deducted if useless files are found in the homework directories.)
The file to be submitted should be named as ‘firstname-lastname-offhand-3.zip and submitted in Moodle.
NOTE THAT ALL HOMEWORK IS INDIVIDUAL WORK. NO CODE SHARING AND CO-DEVELOPMENT IS EVER ALLOWED. REFER TO CODE OF CONDUCT STATED IN SYLLABUS. ZERO TOLERANCE FOR ETHIC VIOLATIONS IN THIS COURSE.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more