Skip to content

Commit

Permalink
kram - put back mmap code to fix Win
Browse files Browse the repository at this point in the history
  • Loading branch information
alecazam committed Feb 19, 2023
1 parent b00a5c0 commit 2f3147a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libkram/kram/win_mmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@
#define PROT_WRITE 0x2
#define PROT_EXEC 0x4

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

# define DWORD_HI(x) (x >> 32)
# define DWORD_LO(x) ((x) & 0xffffffff)
// TODO: find out which path this takes, want 64-bit mmsp
#ifdef __USE_FILE_OFFSET64
# define DWORD_HI(x) ((x) >> (uint64_t)32)
# define DWORD_LO(x) ((x) & (uint64_t)0xffffffff)
#else
# define DWORD_HI(x) (0)
# define DWORD_LO(x) (x)
#endif

static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
Expand Down

0 comments on commit 2f3147a

Please sign in to comment.