You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
346 B
27 lines
346 B
#ifndef _MAP_H
|
|
#define _MAP_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#define restrict __restrict__
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
|
|
typedef struct mmap {
|
|
int fd;
|
|
|
|
void* ptr;
|
|
size_t len;
|
|
} mmap_t;
|
|
|
|
int open_and_map(const char* file, mmap_t* restrict ptr);
|
|
int unmap_and_close(mmap_t map);
|
|
|
|
#ifdef _cplusplus
|
|
}
|
|
#undef restrict
|
|
#endif
|
|
|
|
#endif /* _MAP_H */
|