Question
Create a Makefile and Lab1.cpp which links this static library in the build process and uses some of the functions inside. Lab1.cpp must: 1. Call
Create a Makefile and Lab1.cpp which links this static library in the build process and uses some of the functions inside. Lab1.cpp must:
1. Call GetAllPids() and GetNameByPid() to print out all pids and their names.
2. Set pid to 1. Call GetNameByPid() and print out the name of pid 1.
3. Set name to "Lab1". Call GetPidByName() to get the pid of Lab1. Print "Lab1" and the pid of Lab1.
4. Set name to "Lab11". Call GetPidByName() to get the pid of Lab11. There should not be a process called Lab11, therefore this should test your error message generation system.
5. If any errors are generated in the calls to these functions, the error must be printed out by a call to the function GetErrorMsg() with the error number as an argument.
Please provide an answer for Lab1.cpp and Makefile in Linux code language, thank you!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started