File tree Expand file tree Collapse file tree 3 files changed +34
-96
lines changed
libc/include/llvm-libc-macros Expand file tree Collapse file tree 3 files changed +34
-96
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,6 @@ add_header(
1616 sys-ioctl-macros .h
1717)
1818
19- add_header(
20- sys_mman_macros
21- HDR
22- sys-mman-macros .h
23- )
24-
2519add_header(
2620 sys_random_macros
2721 HDR
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99#ifndef __LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H
1010#define __LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H
1111
12- #ifdef __linux__
13- #include "linux/sys-mman-macros.h"
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 different
14+ // architectures.
15+ #if __has_include (< linux /mman .h > )
16+ #include <linux/mman.h>
17+ #else
18+ #error "cannot use <sys/mman.h> without proper system headers."
19+ #endif
20+
21+ // Some posix standard flags may not be defined in system headers.
22+ // Posix mmap flags.
23+ #ifndef MAP_FAILED
24+ #define MAP_FAILED ((void *)-1)
25+ #endif
26+
27+ // Posix memory advise flags. (posix_madvise)
28+ #ifndef POSIX_MADV_NORMAL
29+ #define POSIX_MADV_NORMAL MADV_NORMAL
30+ #endif
31+
32+ #ifndef POSIX_MADV_SEQUENTIAL
33+ #define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
34+ #endif
35+
36+ #ifndef POSIX_MADV_RANDOM
37+ #define POSIX_MADV_RANDOM MADV_RANDOM
38+ #endif
39+
40+ #ifndef POSIX_MADV_WILLNEED
41+ #define POSIX_MADV_WILLNEED MADV_WILLNEED
42+ #endif
43+
44+ #ifndef POSIX_MADV_DONTNEED
45+ #define POSIX_MADV_DONTNEED MADV_DONTNEED
1446#endif
1547
1648#endif // __LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H
You can’t perform that action at this time.
0 commit comments