diff options
| author | Al Hoang <3811822-hoanga@users.noreply.gitlab.com> | 2021-10-31 21:25:20 -0500 |
|---|---|---|
| committer | Al Hoang <3811822-hoanga@users.noreply.gitlab.com> | 2021-11-15 00:29:26 -0600 |
| commit | b875f79dd8807fee1aec8bf443b43ec4f3b53fa9 (patch) | |
| tree | 7cd3c6093df4d5f58e3f15cdccaaf66f43348ff5 /lib/std | |
| parent | 406baf4b1283571c7ef28143eb35f2f24238ef3c (diff) | |
| download | zig-b875f79dd8807fee1aec8bf443b43ec4f3b53fa9.tar.gz zig-b875f79dd8807fee1aec8bf443b43ec4f3b53fa9.zip | |
add fork case for haiku
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/crypto/tlcsprng.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/crypto/tlcsprng.zig b/lib/std/crypto/tlcsprng.zig index a51190c8bd..883e585522 100644 --- a/lib/std/crypto/tlcsprng.zig +++ b/lib/std/crypto/tlcsprng.zig @@ -40,6 +40,7 @@ const maybe_have_wipe_on_fork = builtin.os.isAtLeast(.linux, .{ .major = 4, .minor = 14, }) orelse true; +const is_haiku = builtin.os.tag == .haiku; const Context = struct { init_state: enum(u8) { uninitialized = 0, initialized, failed }, @@ -72,7 +73,7 @@ fn tlsCsprngFill(_: *c_void, buffer: []u8) void { if (wipe_mem.len == 0) { // Not initialized yet. - if (want_fork_safety and maybe_have_wipe_on_fork) { + if (want_fork_safety and maybe_have_wipe_on_fork or is_haiku) { // Allocate a per-process page, madvise operates with page // granularity. wipe_mem = os.mmap( |
