if (tdb->flags & TDB_NOMMAP)
return;
- tdb->map_ptr = mmap(NULL, tdb->map_size,
- PROT_READ|(tdb->read_only? 0:PROT_WRITE),
+ tdb->map_ptr = mmap(NULL, tdb->map_size, tdb->mmap_flags,
MAP_SHARED, tdb->fd, 0);
/*
int ret;
/* We can't hold pointers during this: we could unmap! */
- assert(!tdb->direct_access || tdb_has_expansion_lock(tdb));
+ assert(!tdb->direct_access
+ || (tdb->flags & TDB_NOLOCK)
+ || tdb_has_expansion_lock(tdb));
if (len <= tdb->map_size)
return 0;
tdb->ecode = TDB_ERR_IO;
tdb->log(tdb, TDB_DEBUG_FATAL, tdb->log_priv,
"tdb_write failed at %llu len=%llu (%s)\n",
- off, len, strerror(errno));
+ (long long)off, (long long)len,
+ strerror(errno));
return -1;
}
}