diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-02 13:37:02 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-02 13:37:02 +0100 |
commit | 907b090ddf5734efa11bb423b5873e7dc3070e41 (patch) | |
tree | ec478768a881c358dbddef629257cc1a2f66f872 /Libraries | |
parent | c01f766fb2da533eb3e1c8d102a7d2c99764782f (diff) | |
download | serenity-907b090ddf5734efa11bb423b5873e7dc3070e41.zip |
LibC+Userland: Add a proper syscall wrapper for purge()
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibC/serenity.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibC/serenity.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Libraries/LibC/serenity.cpp b/Libraries/LibC/serenity.cpp index 5b47f6ae41..7ada371ad8 100644 --- a/Libraries/LibC/serenity.cpp +++ b/Libraries/LibC/serenity.cpp @@ -47,4 +47,10 @@ int futex(int32_t* userspace_address, int futex_op, int32_t value, const struct __RETURN_WITH_ERRNO(rc, rc, -1); } +int purge(int mode) +{ + int rc = syscall(SC_purge, mode); + __RETURN_WITH_ERRNO(rc, rc, -1); +} + } diff --git a/Libraries/LibC/serenity.h b/Libraries/LibC/serenity.h index 634d804502..5ab39f7da0 100644 --- a/Libraries/LibC/serenity.h +++ b/Libraries/LibC/serenity.h @@ -58,4 +58,9 @@ int set_process_boost(pid_t, int amount); int futex(int32_t* userspace_address, int futex_op, int32_t value, const struct timespec* timeout); +#define PURGE_ALL_VOLATILE 0x1 +#define PURGE_ALL_CLEAN_INODE 0x2 + +int purge(int mode); + __END_DECLS |