From 4a94b1b92afaed4d80513613936d08aec0b54ee6 Mon Sep 17 00:00:00 2001 From: Trung Nguyen <57174311+trungnt2910@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:43:00 +0000 Subject: [PATCH] libc: Add macros for madv constants This is helpful for code detecting certain `madvise` constants at compile time. Such macros have already been defined for other constants like `O_*`. --- libc/sysv/consts/madv.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libc/sysv/consts/madv.h b/libc/sysv/consts/madv.h index 613645db5..5fb36d05c 100644 --- a/libc/sysv/consts/madv.h +++ b/libc/sysv/consts/madv.h @@ -33,5 +33,27 @@ extern const unsigned MADV_COLLAPSE; #define MADV_SEQUENTIAL 2 #define MADV_WILLNEED 3 +#define MADV_DODUMP MADV_DODUMP +#define MADV_DOFORK MADV_DOFORK +#define MADV_DONTDUMP MADV_DONTDUMP +#define MADV_DONTFORK MADV_DONTFORK +#define MADV_DONTNEED MADV_DONTNEED +#define MADV_FREE MADV_FREE +#define MADV_HUGEPAGE MADV_HUGEPAGE +#define MADV_HWPOISON MADV_HWPOISON +#define MADV_MERGEABLE MADV_MERGEABLE +#define MADV_NOHUGEPAGE MADV_NOHUGEPAGE +#define MADV_REMOVE MADV_REMOVE +#define MADV_UNMERGEABLE MADV_UNMERGEABLE +#define MADV_SOFT_OFFLINE MADV_SOFT_OFFLINE +#define MADV_WIPEONFORK MADV_WIPEONFORK +#define MADV_KEEPONFORK MADV_KEEPONFORK +#define MADV_COLD MADV_COLD +#define MADV_PAGEOUT MADV_PAGEOUT +#define MADV_POPULATE_READ MADV_POPULATE_READ +#define MADV_POPULATE_WRITE MADV_POPULATE_WRITE +#define MADV_DONTNEED_LOCKED MADV_DONTNEED_LOCKED +#define MADV_COLLAPSE MADV_COLLAPSE + COSMOPOLITAN_C_END_ #endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MADV_H_ */