Created
May 3, 2017 15:32
-
-
Save coldnebo/98d6166feb4c16220afe451a012c98a0 to your computer and use it in GitHub Desktop.
fix for compile issue encountered in https://github.com/rvm/rvm/issues/4000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/random.c b/random.c | |
index e669e98..9334921 100644 | |
--- a/random.c | |
+++ b/random.c | |
@@ -521,7 +521,7 @@ fill_random_bytes_syscall(void *seed, size_t size, int unused) | |
CryptGenRandom(prov, size, seed); | |
return 0; | |
} | |
-#elif defined __linux__ && defined SYS_getrandom | |
+#elif defined __linux__ && defined __NR_getrandom | |
#include <linux/random.h> | |
# ifndef GRND_NONBLOCK | |
@@ -538,7 +538,7 @@ fill_random_bytes_syscall(void *seed, size_t size, int need_secure) | |
if (!need_secure) | |
flags = GRND_NONBLOCK; | |
errno = 0; | |
- ret = syscall(SYS_getrandom, seed, size, flags); | |
+ ret = syscall(__NR_getrandom, seed, size, flags); | |
if (errno == ENOSYS) { | |
ATOMIC_SET(try_syscall, 0); | |
return -1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
same as patch for reported ruby issue: