Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program ( you

In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program (you are writing a simple user-interface to the operating system).
should operate in a fashion similar to that as illustrated in the book, in Figure 1-19:
while (true){
print a command prompt
get a line of user input
if (they didn't type "exit" or "cd"){
create a child process
if (I am the parent)
wait for the child
else (I am the child)
directly execute the sys call
OR -
execute the command using a version of exec.
}
}
System Calls
This list may not represent all possible options, especially for the time information and the host name.
Time information: gettimeofday, localtime, strftime
Getting the host name: uname, gethostname
Creating (making) a directory: mkdir
Removing a directory: rmdir
Printing working directory: getcwd
Changing directory: chdir
Kill: kill. Note that when implementing this one, just have it send a signal 9 to the identified PID.
Creating a child process: fork
Waiting for a child process: waitpid, wait
image text in transcribed

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

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

What is topology? Explain with examples

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago