Don't call vm_map_findspace() when MAP_TRYFIXED is specified.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 23 Apr 2009 22:18:10 +0000 (15:18 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 23 Apr 2009 22:18:10 +0000 (15:18 -0700)
MAP_TRYFIXED is intended to return the requested address or an error.

sys/vm/vm_map.c

index 0747983..a326037 100644 (file)
@@ -3035,7 +3035,7 @@ vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
        /*
         * Find space for the mapping
         */
-       if ((flags & MAP_FIXED) == 0) {
+       if ((flags & (MAP_FIXED | MAP_TRYFIXED)) == 0) {
                if (vm_map_findspace(map, addrbos, max_ssize, 1,
                                     flags, &tmpaddr)) {
                        vm_map_unlock(map);