Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
spins:invis:rootpack
libapr1
apr-use-getrandom.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File apr-use-getrandom.patch of Package libapr1
diff --git a/misc/unix/rand.c b/misc/unix/rand.c index c1e1e8f..e443d7e 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -43,6 +43,9 @@ #include <sys/uuid.h> #endif +#include <sys/syscall.h> +#include <linux/random.h> + #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif @@ -89,6 +92,12 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, { #ifdef DEV_RANDOM +#ifdef __NR_getrandom + int r = TEMP_FAILURE_RETRY(syscall(__NR_getrandom, buf, length, 0)); + if(r != -1 && r == length) + return APR_SUCCESS; + /* If this fails for whatever reason..fallback to the old ways.. */ +#endif int fd = -1; /* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor