Software /
code /
prosody
Comparison
util-src/crand.c @ 8425:91c220f43826
util.crand: Add comments about defines
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 01 Dec 2017 00:56:11 +0100 |
parent | 8424:b0a267f77d9e |
child | 8443:980885ba062c |
comparison
equal
deleted
inserted
replaced
8424:b0a267f77d9e | 8425:91c220f43826 |
---|---|
29 #include "lauxlib.h" | 29 #include "lauxlib.h" |
30 | 30 |
31 #if defined(WITH_GETRANDOM) | 31 #if defined(WITH_GETRANDOM) |
32 | 32 |
33 #ifndef __GLIBC_PREREQ | 33 #ifndef __GLIBC_PREREQ |
34 /* Not compiled with glibc at all */ | |
34 #define __GLIBC_PREREQ(a,b) 0 | 35 #define __GLIBC_PREREQ(a,b) 0 |
35 #endif | 36 #endif |
36 | 37 |
37 #if ! __GLIBC_PREREQ(2,25) | 38 #if ! __GLIBC_PREREQ(2,25) |
39 /* Not compiled with a glibc that provides getrandom() */ | |
38 #include <unistd.h> | 40 #include <unistd.h> |
39 #include <sys/syscall.h> | 41 #include <sys/syscall.h> |
40 | 42 |
41 #ifndef SYS_getrandom | 43 #ifndef SYS_getrandom |
42 #error getrandom() requires Linux 3.17 or later | 44 #error getrandom() requires Linux 3.17 or later |