avoid trying to use mremap outside of Linux

This commit is contained in:
Daniel Micay 2019-07-05 21:59:44 -04:00
parent 934ab4cb59
commit a32e26b8e9
3 changed files with 10 additions and 0 deletions

View file

@ -3,6 +3,10 @@
#include <stddef.h>
#ifdef __linux__
#define HAVE_COMPATIBLE_MREMAP
#endif
int get_metadata_key(void);
void *memory_map(size_t size);
@ -11,8 +15,10 @@ int memory_unmap(void *ptr, size_t size);
int memory_protect_ro(void *ptr, size_t size);
int memory_protect_rw(void *ptr, size_t size);
int memory_protect_rw_metadata(void *ptr, size_t size);
#ifdef HAVE_COMPATIBLE_MREMAP
int memory_remap(void *old, size_t old_size, size_t new_size);
int memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);
#endif
void memory_set_name(void *ptr, size_t size, const char *name);
#endif