blob: bd63f6506fbfdf4921ba62e4f8af9cbd48147215 [file] [log] [blame]
David Sehr10db8fe2018-07-18 11:01:20 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_LIBARTBASE_BASE_MMAN_H_
18#define ART_LIBARTBASE_BASE_MMAN_H_
19
20#ifdef _WIN32
21
22// There is no sys/mman.h in mingw.
23// As these are just placeholders for the APIs, all values are stubbed out.
24
25#define PROT_READ 0 // 0x1
26#define PROT_WRITE 0 // 0x2
27#define PROT_EXEC 0 // 0x4
28#define PROT_NONE 0 // 0x0
29
30#define MAP_SHARED 0 // 0x01
31#define MAP_PRIVATE 0 // 0x02
32
33#define MAP_FAILED nullptr // ((void*) -1)
34#define MAP_FIXED 0 // 0x10
35#define MAP_ANONYMOUS 0 // 0x20
36
37#else
38
39#include <sys/mman.h>
40
41#endif
42
43
44#endif // ART_LIBARTBASE_BASE_MMAN_H_