mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00

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. :^)
43 lines
787 B
C
43 lines
787 B
C
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Kernel/API/POSIX/sys/types.h>
|
|
#include <Kernel/API/POSIX/time.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define MAP_FILE 0x00
|
|
#define MAP_SHARED 0x01
|
|
#define MAP_PRIVATE 0x02
|
|
#define MAP_FIXED 0x10
|
|
#define MAP_ANONYMOUS 0x20
|
|
#define MAP_ANON MAP_ANONYMOUS
|
|
#define MAP_STACK 0x40
|
|
#define MAP_NORESERVE 0x80
|
|
#define MAP_RANDOMIZED 0x100
|
|
#define MAP_PURGEABLE 0x200
|
|
|
|
#define PROT_READ 0x1
|
|
#define PROT_WRITE 0x2
|
|
#define PROT_EXEC 0x4
|
|
#define PROT_NONE 0x0
|
|
|
|
#define MAP_FAILED ((void*)-1)
|
|
|
|
#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
|