unformat_free (&input);
close (fd);
- count_leading_zeros (bits, end);
+ bits = count_leading_zeros (end);
bits = 64 - bits;
if (bits >= 36 && bits <= 48)
return ((1ul << bits) / 4) - (2 * SVM_GLOBAL_REGION_SIZE);
if (a->flags & SVM_FLAGS_MHEAP)
{
+ mheap_t *heap_header;
rp->data_heap =
mheap_alloc_with_flags ((void *) (rp->data_base), map_size,
MHEAP_FLAG_DISABLE_VM);
+ heap_header = mheap_header (rp->data_heap);
+ heap_header->flags |= MHEAP_FLAG_THREAD_SAFE;
+
rp->flags |= SVM_FLAGS_MHEAP;
}
return 0;
return (0);
}
+ /* Reset ownership in case the client started first */
+ if (fchown (svm_fd, a->uid, a->gid) < 0)
+ clib_unix_warning ("segment chown [ok if client starts first]");
+
time_left = 20;
while (1)
{
return (0);
}
+ close (svm_fd);
+
if ((uword) rp != rp->virtual_base)
{
clib_warning ("mmap botch");