Showing posts with the label C programsShow all
Write a C program that behaves like a shell which displays the command prompt ‘myshell$’. It accepts the command, tokenize the command line and execute it by creating the child process. Also implement the additional command ‘typeline’ as myshell$ typeline n filename: It will display first n lines of the file. myshell$ typeline -n filename: It will display last n lines of the file. myshell$ typeline a filename: It will display all the lines of the file.
Write a C program that behaves like a shell which displays the command prompt ‘myshell$’. It accepts the command, tokenize the command line and execute it by creating the child process. Also implement the additional command ‘count’ as myshell$ count c filename: It will display the number of characters in given file myshell$ count w filename: It will display the number of words in given file myshell$ count l filename: It will display the number of lines in given file.
Implement the C program to accept n integers to be sorted. Main function creates child process using fork system call. Parent process sorts the integers using bubble sort and waits for child process using wait system call. Child process sorts the integers using insertion sort. | Write a C program to illustrate the concept of orphan process. Parent process creates a child and terminates before child has finished its task. So child process becomes orphan process. (Use fork(), sleep(), getpid(), getppid())
Implement the C Program to create a child process using fork(), display parent and child process id. Child process will display the message “I am Child Process” and the parent process should display “I am Parent Process” | Write a program that demonstrates the use of nice() system call. After a child process is started using fork(), assign higher priority to the child using nice() system call.
CPU Scheduling - OS Practical Assignment 2022
Load More That is All