if (size == env->me_head.mh_psize) { /* there is only the header */
if (p_next != NULL)
*p_next = 1;
+ env->me_meta.mm_stat.ms_psize = env->me_head.mh_psize;
return MDB_SUCCESS; /* new file */
}
{
MDB_env *e;
- if (!size) return EINVAL;
-
e = calloc(1, sizeof(*e));
if (!e) return ENOMEM;
newenv = 1;
}
+ if (!env->me_mapsize)
+ env->me_mapsize = env->me_head.mh_mapsize;
+
i = MAP_SHARED;
if (env->me_head.mh_address && (flags & MDB_FIXEDMAP))
i |= MAP_FIXED;