Skip to content

Commit

Permalink
Add a fallback definition for __NR_getrandom for ARM linux
Browse files Browse the repository at this point in the history
Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#9619)
  • Loading branch information
bernd-edlinger committed Aug 19, 2019
1 parent 784883f commit 24d932e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crypto/rand/rand_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
# endif

# if defined(OPENSSL_RAND_SEED_GETRANDOM)

# if defined(__linux) && !defined(__NR_getrandom)
# if defined(__arm__) && defined(__NR_SYSCALL_BASE)
# define __NR_getrandom (__NR_SYSCALL_BASE+384)
# endif
# endif

/*
* syscall_random(): Try to get random data using a system call
* returns the number of bytes returned in buf, or < 0 on error.
Expand Down

0 comments on commit 24d932e

Please sign in to comment.