Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before this commit, he header of a mapped area, `struct map`, was defined as follows: struct map { int prot; int flags; off_t offset; size_t length; char body[]; }; Because the size and alignment of an `off_t` is 8 bytes, the entire structure was padded to 24 bytes. However, the offset of `body` into `struct map` was only 20 bytes. Therefore the code in mmap() and munmap() did not agree on the offset from header to body. This commit changes mmap() to skip the entire header, which is what munmap() expects and what the size calculation uses.
- Loading branch information