Skip to content

Commit

Permalink
Make mmap() possible to use in a conformant way. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark authored May 26, 2020
1 parent 9b9d243 commit 3e9892f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libc-bottom-half/mman/mman.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ struct map {
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset) {
// Check for unsupported flags.
if ((flags & MAP_FIXED) != 0 ||
if ((flags & (MAP_PRIVATE | MAP_SHARED)) == 0 ||
(flags & MAP_FIXED) != 0 ||
#ifdef MAP_SHARED_VALIDATE
(flags & MAP_SHARED_VALIDATE) != 0 ||
(flags & MAP_SHARED_VALIDATE) == MAP_SHARED_VALIDATE ||
#endif
#ifdef MAP_NORESERVE
(flags & MAP_NORESERVE) != 0 ||
Expand Down

0 comments on commit 3e9892f

Please sign in to comment.