Path: blob/main/system/lib/llvm-libc/include/llvm-libc-macros/sys-mman-macros.h
6179 views
//===-- Macros defined in sys/mman.h header file --------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H9#define LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H1011// Use definitions from <linux/mman.h> to dispatch arch-specific flag values.12// For example, MCL_CURRENT/MCL_FUTURE/MCL_ONFAULT are different on different13// architectures.14#if __has_include(<linux/mman.h>)15#include <linux/mman.h>16#else17#error "cannot use <sys/mman.h> without proper system headers."18#endif1920// Some posix standard flags may not be defined in system headers.21// Posix mmap flags.22#ifndef MAP_FAILED23#define MAP_FAILED ((void *)-1)24#endif2526// Posix memory advise flags. (posix_madvise)27#ifndef POSIX_MADV_NORMAL28#define POSIX_MADV_NORMAL MADV_NORMAL29#endif3031#ifndef POSIX_MADV_SEQUENTIAL32#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL33#endif3435#ifndef POSIX_MADV_RANDOM36#define POSIX_MADV_RANDOM MADV_RANDOM37#endif3839#ifndef POSIX_MADV_WILLNEED40#define POSIX_MADV_WILLNEED MADV_WILLNEED41#endif4243#ifndef POSIX_MADV_DONTNEED44#define POSIX_MADV_DONTNEED MADV_DONTNEED45#endif4647#endif // LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H484950