From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.0.7) Gecko/20060915 Firefox/1.5.0.7 Description of problem: The man page for mmap(2) states the following concerning the address hint passed to mmap(): The address start must be a multiple of the page size. and: EINVAL We don't like start or length or offset. (E.g., they are too large, or not aligned on a PAGESIZE boundary.) In fact, if "start" is unaligned, it is rounded up to the next PAGESIZE boundary by mmap(2). No error is returned unless MAP_FIXED is specified. Instead, the man page should state that if "start" is an unaligned address hint, it will be rounded up to the next PAGESIZE boundary. Version-Release number of selected component (if applicable): man-pages-2.21-1 How reproducible: Always Steps to Reproduce: 1. Save the following program as m.c: #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> int main() { void *ptr; int fd; if ((fd = open("m.c", O_RDWR)) < 0) { perror("m.c"); exit(1); } if ((ptr = mmap((void *)1, 0x500, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) { perror("mmap"); (void) close(fd); exit (1); } printf("mmap #1 succeeded, ptr @ %p = 0x%x\n", ptr, *(int *)ptr); (void) close(fd); exit(0); } 2. Compile m.c (gcc m.c) 3. Run the program and notice it does not fail with EINVAL. Actual Results: # ./a.out mmap #1 succeeded, ptr @ 0x1000 = 0x636e6923 Expected Results: According to the man page, this should have failed with the same results given if MAP_FIXED is specified: mmap: Invalid argument Additional info:
Fixed in man-pages-2.41-2.fc7.