Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
convert the following program into a shell script, including redirection of input and output, pipes, and background jobs.:
#define TRUE 1
while (TRUE) /* repeat forever */
{
type_prompt(); /* display prompt on the screen */
read_command(command, parameters); /* read input from terminal */
if (fork() != 0) /* fork off child process */
{
/*Parent code.*/
waitpid(1, &status, 0); /* wait for child to exit */
}
else
{
/* Child code. */
execve(command, parameters, 0); /* execute command */
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Part II: Processes and Threads. Write a C program that will creates a child process. The child will ask the user to enter an integers x and then sends it to the parent via pipe. The parent should print your student's ID if x > 0 or your full student name if x 0 and 01998877 if x <= 0. Note: cach student should print his own id and name as they appear on the UMS. The inter-processes communication should be using pipes.arrow_forward1) Design and implement a Java program to make a chat platform using synchronization between 3 threads. a) Design a flowchart of your design b) Implement your designarrow_forwardConsider the following C++ code: while (true) { while (counter == 0) ; /* do nothing / next.consumed = buffer[out]; (out + 1) % BUFFER_SIZE; out = counter--; /* consume the item in next_consumed / In the operating system the above code called and routines.arrow_forward
- Write the C program that accepts two arguments. The arguments are the name of two executable scripts located in the current folder. The child must execute the first argument and the parent must wait for the child to complete and then execute the code given in the second argument.arrow_forward26. Semophores are used to solve the problem of a. race condition b. process synchronization c. mutual exclusion d. belady problemarrow_forwardPlease write a C program. Consider the following code snippet in your main function -a = fork();b = fork();c = fork();Now, write the full program, that will check the children’s PID and if it is odd then the processwill create another child process. Lastly, print how many processes have been createdconsidering the first parent processarrow_forward
- THIS IS A COMMON TRANSITION WHERE THE CURRENTLY RUNNING PROCESS HAS REACHED ITS MAXIMUM ALLOWABLE TIME FOR EXECUTION. Select one: a.RUNNING --> READY b.READY --> RUNNING c.RUNNING -> BLOCKED d.RUNNING -> EXITarrow_forwardMulti-tasking can not be achieved with a single processor machine. True False 2. Async/Await is best for network bound operations while multi-threading and parallel programming is best for CPU-bound operations. True False 3. The following is a characteristic of an async method:The name of an async method, by convention, ends with an "Async" suffix. True False 4. Using asynchronous code for network bound operations can speed up the time needed to contact the server and get the data back. True False 5. Asynchronous programming has been there for a long time but has tremendously been improved by the simplified approach of async programming in C# 5 through the introduction of: The Task class True Falsearrow_forwardPlease answer this questionarrow_forward
- Select all statements below that are true O A set of processes is in a safe state S if S is not a deadlock state and any state T reachable from S is not a deadlock state. In order for a deadlock to occur, only one of the four conditions necessary for deadlocks to occur must be satisfied. O A deadlock means that at least two processes cannot continue working because they are waiting for each to make resources available. о One of the the four conditions necessary for deadlocks to occur is non- preemption. Interrupts, messages, and signals are examples of consumable resources. Reusable resources are produced and consumed dynamically. QL - DELL Warrow_forwardWrite a program i.e. is a version of a shell that can take command(s) from the user and execute them on behalf of the user (by spawning a child process to execute the command on behalf of the parent process). It can only execute a few commands as listed below: [+] mkdir [ ... ] [+] ls [] [+] cp [+] mv [ ... ] [+] rm where parameters enclosed in [ ] are optional parameters. Note that multiple commands are recognized by the shell if each command is delimited by ";". These commands will be executed one after the other. Write a C program will act as a shell interface that should accept and execute each command in a separate process. There should be a parent process that will read the command and then the parent process will create a child process that will execute the command. The parent process should wait for the child process before continuing. Your program should mimic the Linux terminal. This program should be written in C and executed in Linux. You are required to implement five…arrow_forwardWrite a C++ source code to achieve following design specifications; A secure login screen which allows only the user to enter the system (You canprovide any user name and password). Any other user must be greeted with a warning message reading ‘Incorrectusername/password. Please try again’ A maximum of only three login attempts must be given after which the system mustexit. The system must clear the screen after logged to the system. Once the user has successfully logged in, he/she must be greeted with a messagereading “Welcome to System”arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education