c program.
Problem 2 – measuring cost of system call
Purpose: to understand mode switch penalty and the costdifference among system calls.
Your task is to write a C program that measures the latencies ofvarious system calls. In particular, you want to know 1) the costof CPU mode switch by measuring a light-weight system call whichdoes very little thing in the kernel, and 2) the cost of heaviersystem calls which triggers a lot of activities inside thekernel.
Your program should measure the latencies of three system calls:getpid(), open(), and read(). getpid() represents lightweight call,and open()/read() represent heavy system calls. For high-resolutionlatency measurements, you should
PayPal Gateway not configured
PayPal Gateway not configured