libuv/2524.patch
Stephen Gallagher bd8f350fdf
Add upstream patch to fix aarch64 builds
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2019-10-21 09:09:26 -04:00

37 lines
1.3 KiB
Diff

From eb5552190000b9699bba33e1e419f500c7bd18b7 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Sat, 19 Oct 2019 09:54:46 +0200
Subject: [PATCH] linux: fix arm64 SYS__sysctl build breakage
The arm64 architecture never had a _sysctl system call and therefore
doesn't have a SYS__sysctl define either. Always return UV_ENOSYS.
Fixes: https://github.com/libuv/libuv/issues/2522
---
src/unix/random-sysctl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/unix/random-sysctl.c b/src/unix/random-sysctl.c
index 7af2e32070..fb182ded09 100644
--- a/src/unix/random-sysctl.c
+++ b/src/unix/random-sysctl.c
@@ -65,9 +65,18 @@ int uv__random_sysctl(void* buf, size_t buflen) {
* an okay trade-off for the fallback of the fallback: this function is
* only called when neither getrandom(2) nor /dev/urandom are available.
* Fails with ENOSYS on kernels configured without CONFIG_SYSCTL_SYSCALL.
+ * At least arm64 never had a _sysctl system call and therefore doesn't
+ * have a SYS__sysctl define either.
*/
+#ifdef SYS__sysctl
if (syscall(SYS__sysctl, &args) == -1)
return UV__ERR(errno);
+#else
+ {
+ (void) &args;
+ return UV_ENOSYS;
+ }
+#endif
if (n != sizeof(uuid))
return UV_EIO; /* Can't happen. */