瀏覽代碼

Kernel: Add the remaining POSIX `MADV_*` constants

Tim Schumacher 3 年之前
父節點
當前提交
6d59d4d3d9
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      Kernel/API/POSIX/sys/mman.h

+ 6 - 5
Kernel/API/POSIX/sys/mman.h

@@ -36,15 +36,16 @@ extern "C" {
 #define MADV_SET_VOLATILE 0x1
 #define MADV_SET_VOLATILE 0x1
 #define MADV_SET_NONVOLATILE 0x2
 #define MADV_SET_NONVOLATILE 0x2
 #define MADV_DONTNEED 0x3
 #define MADV_DONTNEED 0x3
+#define MADV_WILLNEED 0x4
+#define MADV_SEQUENTIAL 0x5
+#define MADV_RANDOM 0x6
 
 
 // https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_madvise.html
 // https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_madvise.html
 #define POSIX_MADV_NORMAL MADV_NORMAL
 #define POSIX_MADV_NORMAL MADV_NORMAL
 #define POSIX_MADV_DONTNEED MADV_DONTNEED
 #define POSIX_MADV_DONTNEED MADV_DONTNEED
-
-// Unsupported posix_madvise() advise:
-//  POSIX_MADV_SEQUENTIAL
-//  POSIX_MADV_RANDOM
-//  POSIX_MADV_WILLNEED
+#define POSIX_MADV_WILLNEED MADV_WILLNEED
+#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
+#define POSIX_MADV_RANDOM MADV_RANDOM
 
 
 #define MS_SYNC 1
 #define MS_SYNC 1
 #define MS_ASYNC 2
 #define MS_ASYNC 2