brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · a6dc6d9 Raw
49 lines · c
1//===-- Macros defined in sys/mman.h header file --------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H10#define LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H11 12// Use definitions from <linux/mman.h> to dispatch arch-specific flag values.13// For example, MCL_CURRENT/MCL_FUTURE/MCL_ONFAULT are different on different14// architectures.15#if __has_include(<linux/mman.h>)16#include <linux/mman.h>17#else18#error "cannot use <sys/mman.h> without proper system headers."19#endif20 21// Some posix standard flags may not be defined in system headers.22// Posix mmap flags.23#ifndef MAP_FAILED24#define MAP_FAILED ((void *)-1)25#endif26 27// Posix memory advise flags. (posix_madvise)28#ifndef POSIX_MADV_NORMAL29#define POSIX_MADV_NORMAL MADV_NORMAL30#endif31 32#ifndef POSIX_MADV_SEQUENTIAL33#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL34#endif35 36#ifndef POSIX_MADV_RANDOM37#define POSIX_MADV_RANDOM MADV_RANDOM38#endif39 40#ifndef POSIX_MADV_WILLNEED41#define POSIX_MADV_WILLNEED MADV_WILLNEED42#endif43 44#ifndef POSIX_MADV_DONTNEED45#define POSIX_MADV_DONTNEED MADV_DONTNEED46#endif47 48#endif // LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H49