Merge pull request #2 from abliss/getrandom

Actually try calling getrandom while configuring
This commit is contained in:
Steven Dee 2019-01-18 08:15:14 -08:00 committed by GitHub
commit 91d5fff630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,9 +29,9 @@ if not have_getentropy
#include <asm/unistd.h>
#include <unistd.h>
#include <sys/syscall.h>
int main() { return !syscall(SYS_getrandom, (void*)0, 0, 0); }
int main() { return !(syscall(SYS_getrandom, (void*)0, 0, 0) >= 0); }
'''
getrandom = cc.links(code, name: 'getrandom syscall available')
getrandom = cc.run(code, name: 'getrandom syscall available').returncode() == 0
conf_data.set('ENT_GETRANDOM', getrandom)
if not getrandom