Don't assume that madvise() is available even if related macros are defined.
This commit is contained in:
parent
133118ca4d
commit
d0eab9323f
@ -407,7 +407,7 @@ dnl Checks for functions and headers
|
|||||||
|
|
||||||
AS_IF([test "x$EMSCRIPTEN" = "x"],[
|
AS_IF([test "x$EMSCRIPTEN" = "x"],[
|
||||||
AC_CHECK_FUNCS([arc4random arc4random_buf])
|
AC_CHECK_FUNCS([arc4random arc4random_buf])
|
||||||
AC_CHECK_FUNCS([mlock mprotect explicit_bzero])
|
AC_CHECK_FUNCS([mlock madvise mprotect explicit_bzero])
|
||||||
])
|
])
|
||||||
AC_CHECK_FUNCS([posix_memalign])
|
AC_CHECK_FUNCS([posix_memalign])
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen,
|
|||||||
int
|
int
|
||||||
sodium_mlock(void * const addr, const size_t len)
|
sodium_mlock(void * const addr, const size_t len)
|
||||||
{
|
{
|
||||||
#ifdef MADV_DONTDUMP
|
#if defined(MADV_DONTDUMP) && defined(HAVE_MADVISE)
|
||||||
(void) madvise(addr, len, MADV_DONTDUMP);
|
(void) madvise(addr, len, MADV_DONTDUMP);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MLOCK
|
#ifdef HAVE_MLOCK
|
||||||
@ -192,7 +192,7 @@ int
|
|||||||
sodium_munlock(void * const addr, const size_t len)
|
sodium_munlock(void * const addr, const size_t len)
|
||||||
{
|
{
|
||||||
sodium_memzero(addr, len);
|
sodium_memzero(addr, len);
|
||||||
#ifdef MADV_DODUMP
|
#if defined(MADV_DODUMP) && defined(HAVE_MADVISE)
|
||||||
(void) madvise(addr, len, MADV_DODUMP);
|
(void) madvise(addr, len, MADV_DODUMP);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MLOCK
|
#ifdef HAVE_MLOCK
|
||||||
|
Loading…
Reference in New Issue
Block a user