Linux system call using C programming. Write a system call that reports the foll
ID: 3712148 • Letter: L
Question
Linux system call using C programming.
Write a system call that reports the following statistics about Linux page cache:
1. the current number of pages in the active list over all memory zones.
2. the current number of pages in the inactive list over all memory zones.
3. the current number of pages in the active list whose reference bit is set over all memory zones.
4. the current number of pages in the inactive list whose reference bit is set over all memory zones.
Write a user level program to test the system call.
Explanation / Answer
#include <stdio.h>
#include <linux/unistd.h>
#include <sys/syscall.h>
#define _memstats_ 327
int main(){
printf("Page size is: %i ", getpagesize());
syscall(_memstats_);
return 0;
}
USING cat /proc/meminfo we can get the answer for all the above questions.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.