1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibC+Userland: Add a proper syscall wrapper for purge()

This commit is contained in:
Andreas Kling 2020-01-02 13:37:02 +01:00
parent c01f766fb2
commit 907b090ddf
3 changed files with 17 additions and 4 deletions

View file

@ -1,10 +1,8 @@
#include <Kernel/Syscall.h>
#include <serenity.h>
#include <stdio.h>
#include <string.h>
#define PURGE_ALL_VOLATILE 0x1
#define PURGE_ALL_CLEAN_INODE 0x2
int main(int argc, char** argv)
{
int mode = 0;
@ -20,7 +18,11 @@ int main(int argc, char** argv)
return 1;
}
}
int purged_page_count = syscall(SC_purge, mode);
int purged_page_count = purge(mode);
if (purged_page_count < 0) {
perror("purge");
return 1;
}
printf("Purged page count: %d\n", purged_page_count);
return 0;
}