diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-03-08 00:22:20 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-03-08 00:25:57 +0100 |
| commit | 31693290ed717d700480774f4f6b49dbe9b9b704 (patch) | |
| tree | 4cbbeb7ea82a950ea3c9ebadea6276d750482c4b /examples/c4cat.c | |
| parent | 841ee0e92516827e6dd6f2101903b5ec1cc85fb4 (diff) | |
| download | cc4group-31693290ed717d700480774f4f6b49dbe9b9b704.tar.gz cc4group-31693290ed717d700480774f4f6b49dbe9b9b704.zip | |
Windows support (hopefully!)
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)); } |
