CWB
Defines | Typedefs | Functions

windows-mmap.h File Reference

#include <windows.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdio.h>
#include <io.h>

Defines

Typedefs

Functions


Define Documentation

#define MAP_FAILED   ((void*)-1)

Referenced by mmap(), and mmapfile().

#define MAP_PRIVATE   0x02

Referenced by mmap().

#define MAP_SHARED   0x01

Referenced by mmapfile().

#define PROT_READ   1

Referenced by mmapfile().

#define PROT_WRITE   2

Referenced by mmapfile().


Typedef Documentation

typedef char* caddr_t

Function Documentation

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

Substitute POSIX mmap() for use in Windows.

It wraps the Windows API functions CreateFileMapping() and MapViewOfFileEx().

The arguments, return, etc. are the same as POSIX mmap(), which is documented much more thoroughly than we could hope to do here.

References MAP_FAILED, and MAP_PRIVATE.

Referenced by mmapfile().

int munmap ( void *  start,
size_t  length 
)

Substitute POSIX munmap() for environments that lack it.

It wraps the Windows API function UnmapViewOfFile().

See also:
mmap

Referenced by mfree().