Define MAP_FAILED where relevant if undefined

On systems such as HP-UX 10.20, MAP_FAILED is not
defined.
This commit is contained in:
Larkin Nickle
2021-10-21 19:15:15 -04:00
parent cccefb962b
commit 07bdfeedb8
3 changed files with 12 additions and 0 deletions

View File

@@ -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))

View File

@@ -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

View File

@@ -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.
*/