Skip to content

Instantly share code, notes, and snippets.

@carloscarcamo
Forked from coldnebo/rubyvm.patch
Created August 14, 2017 22:41
Show Gist options
  • Save carloscarcamo/c88c668fa801d75c094b71ad4d23a72f to your computer and use it in GitHub Desktop.
Save carloscarcamo/c88c668fa801d75c094b71ad4d23a72f to your computer and use it in GitHub Desktop.
fix for compile issue encountered in https://github.com/rvm/rvm/issues/4000
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