From 334d48006ffba9b275e2cbc8d4d1e7be4fde6788 Mon Sep 17 00:00:00 2001 From: Michal Biesek Date: Fri, 11 Aug 2023 23:18:14 +0200 Subject: [PATCH] Add `MADV_COLD` definition from linux v5.4 see linux commit 9c276cc65a58faf98be8e56962745ec99ab87636 mm: introduce MADV_COLD --- libc/sysv/consts.sh | 1 + libc/sysv/consts/MADV_COLD.S | 2 ++ libc/sysv/consts/madv.h | 1 + 3 files changed, 4 insertions(+) create mode 100644 libc/sysv/consts/MADV_COLD.S diff --git a/libc/sysv/consts.sh b/libc/sysv/consts.sh index 5d84f3089..522663ea0 100755 --- a/libc/sysv/consts.sh +++ b/libc/sysv/consts.sh @@ -267,6 +267,7 @@ syscon madv MADV_NOHUGEPAGE 15 15 127 127 127 127 127 127 # T syscon madv MADV_DODUMP 17 17 127 127 127 127 127 127 # TODO(jart): what is it? syscon madv MADV_WIPEONFORK 18 18 127 127 127 127 127 127 # TODO: add support ? syscon madv MADV_KEEPONFORK 19 19 127 127 127 127 127 127 # TODO: add support ? +syscon madv MADV_COLD 20 20 127 127 127 127 127 127 # TODO: add support ? syscon madv MADV_DOFORK 11 11 127 127 127 127 127 127 # TODO(jart): what is it? syscon madv MADV_DONTDUMP 16 16 127 127 127 127 127 127 # see MAP_CONCEAL in OpenBSD; TODO(jart): what is it? syscon madv MADV_DONTFORK 10 10 127 127 127 127 127 127 # TODO(jart): what is it? diff --git a/libc/sysv/consts/MADV_COLD.S b/libc/sysv/consts/MADV_COLD.S new file mode 100644 index 000000000..8f1064a43 --- /dev/null +++ b/libc/sysv/consts/MADV_COLD.S @@ -0,0 +1,2 @@ +#include "libc/sysv/consts/syscon.internal.h" +.syscon madv,MADV_COLD,20,20,127,127,127,127,127,127 diff --git a/libc/sysv/consts/madv.h b/libc/sysv/consts/madv.h index 2b3653805..97c4839b3 100644 --- a/libc/sysv/consts/madv.h +++ b/libc/sysv/consts/madv.h @@ -22,6 +22,7 @@ extern const unsigned MADV_WILLNEED; extern const unsigned MADV_SOFT_OFFLINE; extern const unsigned MADV_WIPEONFORK; extern const unsigned MADV_KEEPONFORK; +extern const unsigned MADV_COLD; #define MADV_NORMAL 0 #define MADV_RANDOM 1