From d00dd2b4b5708dfcd47a48fdd577046059fe18ce Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 28 Sep 2024 13:05:54 +0000 Subject: [PATCH] ext/random: haiku supports arc4random api too. close GH-16095 --- NEWS | 3 +++ ext/random/csprng.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3760100f08f..c46578d871c 100644 --- a/NEWS +++ b/NEWS @@ -5,4 +5,7 @@ PHP NEWS - PDO_PGSQL: . Added Iterable support for PDO::pgsqlCopyFromArray. (KentarouTakeda) +- Random: + . Moves from /dev/urandom usage to arc4random_buf on Haiku. (David Carlier) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/random/csprng.c b/ext/random/csprng.c index 8b38985c6ac..73832d7d068 100644 --- a/ext/random/csprng.c +++ b/ext/random/csprng.c @@ -86,7 +86,7 @@ ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes_ex(void *bytes, size_ return FAILURE; } #elif defined(HAVE_ARC4RANDOM_BUF) && ((defined(__OpenBSD__) && OpenBSD >= 201405) || (defined(__NetBSD__) && __NetBSD_Version__ >= 700000001 && __NetBSD_Version__ < 1000000000) || \ - defined(__APPLE__)) + defined(__APPLE__) || defined(__HAIKU__)) /* * OpenBSD until there is a valid equivalent * or NetBSD before the 10.x release