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

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!