diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-26 19:47:41 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-27 16:35:32 +0100 |
commit | 52b50c15fa3b319bb162f0d47fbeb6582842c020 (patch) | |
tree | b90730bbb74a52ac241832145ec6d9116f07731f /libc/sysdeps/linux/common/bits | |
parent | 3506b44a80d3e38904d5c6cd76085c16ad3a165c (diff) |
do not define madvise related macros for noMMU targets
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r-- | libc/sysdeps/linux/common/bits/mman-common.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/libc/sysdeps/linux/common/bits/mman-common.h b/libc/sysdeps/linux/common/bits/mman-common.h index 6cde5daa3..5b20da4d0 100644 --- a/libc/sysdeps/linux/common/bits/mman-common.h +++ b/libc/sysdeps/linux/common/bits/mman-common.h @@ -83,26 +83,29 @@ # define MREMAP_FIXED 2 #endif +/* only define for MMU targets, no-MMU does not support madvise. */ +#ifdef __ARCH_USE_MMU__ /* Advice to `madvise'. */ -#ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ -# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ -# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ -# define MADV_HWPOISON 100 /* Poison a page for testing. */ -#endif +# ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +# endif /* The POSIX people had to invent similar names for the same things. */ -#ifdef __USE_XOPEN2K -# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +# ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +# endif #endif |