File: WindowsMMap.h

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (59 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*===- WindowsMMap.h - Support library for PGO instrumentation ------------===*\
|*
|*                     The LLVM Compiler Infrastructure
|*
|* This file is distributed under the University of Illinois Open Source
|* License. See LICENSE.TXT for details.
|*
\*===----------------------------------------------------------------------===*/

#ifndef PROFILE_INSTRPROFILING_WINDOWS_MMAP_H
#define PROFILE_INSTRPROFILING_WINDOWS_MMAP_H

#if defined(_WIN32)

#include <BaseTsd.h>
#include <io.h>
#include <sys/types.h>

/*
 * mmap() flags
 */
#define PROT_READ     0x1
#define PROT_WRITE    0x2
#define PROT_EXEC     0x0

#define MAP_FILE      0x00
#define MAP_SHARED    0x01
#define MAP_PRIVATE   0x02
#define MAP_ANONYMOUS 0x20
#define MAP_ANON      MAP_ANONYMOUS
#define MAP_FAILED    ((void *) -1)

/*
 * msync() flags
 */
#define MS_ASYNC        0x0001  /* return immediately */
#define MS_INVALIDATE   0x0002  /* invalidate all cached data */
#define MS_SYNC         0x0010  /* msync synchronously */

/*
 * flock() operations
 */
#define   LOCK_SH   1    /* shared lock */
#define   LOCK_EX   2    /* exclusive lock */
#define   LOCK_NB   4    /* don't block when locking */
#define   LOCK_UN   8    /* unlock */

void *mmap(void *start, size_t length, int prot, int flags, int fd,
           off_t offset);

void munmap(void *addr, size_t length);

int msync(void *addr, size_t length, int flags);

int flock(int fd, int operation);

#endif /* _WIN32 */

#endif /* PROFILE_INSTRPROFILING_WINDOWS_MMAP_H */