1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-14 19:56:28 +00:00

Not all systems define MAP_FAILED for the return value from failing mmap() (#502)

This commit is contained in:
Nick Briggs
2024-05-13 15:37:53 -07:00
committed by GitHub
parent 40a1a8dcd2
commit 4becc6ad93

View File

@@ -15,7 +15,10 @@
#include <stdio.h> // for perror, fprintf, printf, stderr, sprintf
#include <stdlib.h> // for exit, free, malloc
#include <string.h> // for memset
#include <sys/mman.h> // for mmap
#include <sys/mman.h> // for mmap, MAP_FAILED
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
#include <sys/stat.h> // for stat, fstat
#include <sys/types.h> // for off_t
#include <unistd.h> // for lseek, read, close, getpagesize