diff --git a/lib/util/getentropy.c b/lib/util/getentropy.c index 4b1795f96..98df88937 100644 --- a/lib/util/getentropy.c +++ b/lib/util/getentropy.c @@ -76,6 +76,10 @@ # define MAP_ANON MAP_ANONYMOUS #endif +#ifndef MAP_FAILED +# define MAP_FAILED ((void *) -1) +#endif + #define REPEAT 5 #define min(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/lib/util/regress/mktemp/mktemp_test.c b/lib/util/regress/mktemp/mktemp_test.c index cd5aa9755..73a5b2919 100644 --- a/lib/util/regress/mktemp/mktemp_test.c +++ b/lib/util/regress/mktemp/mktemp_test.c @@ -31,6 +31,10 @@ # endif #endif +#ifndef MAP_FAILED +# define MAP_FAILED ((void *) -1) +#endif + #define MAX_TEMPLATE_LEN 10 #define MAX_TRIES 100 #define MIN_Xs 6 diff --git a/lib/util/snprintf.c b/lib/util/snprintf.c index 6d027ad72..76278630c 100644 --- a/lib/util/snprintf.c +++ b/lib/util/snprintf.c @@ -116,6 +116,10 @@ static int xxxprintf(char **, size_t, int, const char *, va_list); # define MAP_ANON MAP_ANONYMOUS #endif +#ifndef MAP_FAILED +# define MAP_FAILED ((void *) -1) +#endif + /* * Allocate "size" bytes via mmap. */