summaryrefslogtreecommitdiff
path: root/Kernel/API/POSIX/sys/mman.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-17 19:33:00 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-17 19:34:15 +0100
commit32aa37d5dcfedf90a14696a5a6eec76bc029cffa (patch)
tree61b36cab4480b36db74d6b9f4038b10ffa36a3a8 /Kernel/API/POSIX/sys/mman.h
parentf2d5548d7a46d054f5015e29e90995a70106dc19 (diff)
downloadserenity-32aa37d5dcfedf90a14696a5a6eec76bc029cffa.zip
Kernel+LibC: Add msync() system call
This allows userspace to trigger a full (FIXME) flush of a shared file mapping to disk. We iterate over all the mapped pages in the VMObject and write them out to the underlying inode, one by one. This is rather naive, and there's lots of room for improvement. Note that shared file mappings are currently not possible since mmap() returns ENOTSUP for PROT_WRITE+MAP_SHARED. That restriction will be removed in a subsequent commit. :^)
Diffstat (limited to 'Kernel/API/POSIX/sys/mman.h')
-rw-r--r--Kernel/API/POSIX/sys/mman.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/API/POSIX/sys/mman.h b/Kernel/API/POSIX/sys/mman.h
index 3c996e9699..65a6618385 100644
--- a/Kernel/API/POSIX/sys/mman.h
+++ b/Kernel/API/POSIX/sys/mman.h
@@ -34,6 +34,10 @@ extern "C" {
#define MADV_SET_VOLATILE 0x100
#define MADV_SET_NONVOLATILE 0x200
+#define MS_SYNC 1
+#define MS_ASYNC 2
+#define MS_INVALIDATE 4
+
#ifdef __cplusplus
}
#endif