diff options
Diffstat (limited to 'examples/c4cat.c')
| -rw-r--r-- | examples/c4cat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/c4cat.c b/examples/c4cat.c index 04f51b6..3da506e 100644 --- a/examples/c4cat.c +++ b/examples/c4cat.c @@ -3,11 +3,11 @@ #include <errno.h> #include <string.h> #include <sys/stat.h> -#include <sys/mman.h> #include <fcntl.h> #include <unistd.h> #include "cc4group.h" +#include "platform/platform.h" bool catNormalFile(const char* const path, const off_t size) { @@ -18,7 +18,8 @@ bool catNormalFile(const char* const path, const off_t size) return false; } - void* mappedFile = mmap(NULL, size, PROT_READ, MAP_PRIVATE, file, 0); + void* extra; + void* mappedFile = cc4group_mmap(NULL, size, PROT_READ, MAP_PRIVATE, file, 0, &extra); if(close(file) == -1) { @@ -36,7 +37,7 @@ bool catNormalFile(const char* const path, const off_t size) fprintf(stderr, "ERROR: Writing file contents of \"%s\" to stdout: %s\n", path, strerror(errno)); } - if(munmap(mappedFile, size) == -1) + if(cc4group_munmap(mappedFile, size, extra) == -1) { fprintf(stderr, "ERROR: Unmapping \"%s\": %s\n", path, strerror(errno)); } |
