Question: Question # 1: Implementing print-kernel-release() [20 pts] When the user types '1',the print_kernel_release() function prints the kernel version as follows: 1. See the kernel release

 Question # 1: Implementing print-kernel-release() [20 pts] When the user types

Question # 1: Implementing print-kernel-release() [20 pts] When the user types '1',the print_kernel_release() function prints the kernel version as follows: 1. See the kernel release 2. See the number of cores 3. See the RAM capacity 4. Exit I user types'1' 4.4.0-103-generic The output above is simply the output of the uname command with particular command-line arguments (read the man page to find out which ones) Rather than re-implementing uname to generate this output (which would be painful), implement print_kernel_release() by: Starting a child process Having that child process exec the uname program with the right arguments Wait for the child process to complete . Here are a few hints: There is a whole family of exec system calls (do a man exec and really read the man page). You can use whichever exec you want, but some are more convenient than others. Note that in your real Linux Shell, you can find out the path to any command by typing which and then the command. For instance "which 1s" will tell you where the 1s executable is stored on the file system. Providing full path to exec is typically necessary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!