diff --git a/src/snmalloc/pal/pal_haiku.h b/src/snmalloc/pal/pal_haiku.h index 9cc2b8d48..bafe23c48 100644 --- a/src/snmalloc/pal/pal_haiku.h +++ b/src/snmalloc/pal/pal_haiku.h @@ -20,7 +20,7 @@ namespace snmalloc * PAL supports. * */ - static constexpr uint64_t pal_features = PALPOSIX::pal_features; + static constexpr uint64_t pal_features = PALPOSIX::pal_features | Entropy; /** * Haiku requires an explicit no-reserve flag in `mmap` to guarantee lazy @@ -37,6 +37,15 @@ namespace snmalloc SNMALLOC_ASSERT(is_aligned_block(p, size)); posix_madvise(p, size, POSIX_MADV_DONTNEED); } + + /** + * Hopefully a temporary workaround until the kernel random feature + * is exposed properly in the userspace ? + */ + static uint64_t get_entropy64() + { + return PALPOSIX::dev_urandom(); + } }; } // namespace snmalloc #endif