mmap.c (f00506aeca2f6d92318967693f8da8c713c163f3) | mmap.c (9c255cb53e44d5db57b3388fd6dfab96d4883790) |
---|---|
1/* 2 * mmap support for qemu 3 * 4 * Copyright (c) 2003 - 2008 Fabrice Bellard 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 595 unchanged lines hidden (view full) --- 604 if (!(prot & PROT_WRITE)) { 605 ret = target_mprotect(start, len, prot); 606 assert(ret == 0); 607 } 608 goto the_end; 609 } 610 611 /* Reject the mapping if any page within the range is mapped */ | 1/* 2 * mmap support for qemu 3 * 4 * Copyright (c) 2003 - 2008 Fabrice Bellard 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 595 unchanged lines hidden (view full) --- 604 if (!(prot & PROT_WRITE)) { 605 ret = target_mprotect(start, len, prot); 606 assert(ret == 0); 607 } 608 goto the_end; 609 } 610 611 /* Reject the mapping if any page within the range is mapped */ |
612 if ((flags & MAP_EXCL) && page_check_range(start, len, 0) < 0) { | 612 if ((flags & MAP_EXCL) && !page_check_range_empty(start, end - 1)) { |
613 errno = EINVAL; 614 goto fail; 615 } 616 617 /* handle the start of the mapping */ 618 if (start > real_start) { 619 if (real_end == real_start + qemu_host_page_size) { 620 /* one single host page */ --- 171 unchanged lines hidden --- | 613 errno = EINVAL; 614 goto fail; 615 } 616 617 /* handle the start of the mapping */ 618 if (start > real_start) { 619 if (real_end == real_start + qemu_host_page_size) { 620 /* one single host page */ --- 171 unchanged lines hidden --- |