<p>supersat has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/13209">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Fix build on non-glibc systems<br><br>Change-Id: Id5d577522a4889e152158f7e93ee1c99d3a21003<br>---<br>M src/gsm/gsm_utils.c<br>1 file changed, 8 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/13209/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c</span><br><span>index 02cb3d5..c9c15d5 100644</span><br><span>--- a/src/gsm/gsm_utils.c</span><br><span>+++ b/src/gsm/gsm_utils.c</span><br><span>@@ -100,7 +100,12 @@</span><br><span> </span><br><span> #if (!EMBEDDED)</span><br><span> /* FIXME: this can be removed once we bump glibc requirements to 2.25: */</span><br><span style="color: hsl(0, 100%, 40%);">-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef __GLIBC_PREREQ</span><br><span style="color: hsl(120, 100%, 40%);">+#if __GLIBC_PREREQ(2,25)</span><br><span style="color: hsl(120, 100%, 40%);">+#define HAVE_GLIBC_GETRANDOM</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* if __GLIBC_PREREQ(2,25) */</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* ifdef __GLIBC_PREREQ */</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef HAVE_GLIBC_GETRANDOM</span><br><span> #pragma message ("glibc " OSMO_STRINGIFY_VAL(__GLIBC__) "." OSMO_STRINGIFY_VAL(__GLIBC_MINOR__) " random detected")</span><br><span> #include <sys/random.h></span><br><span> #undef USE_GNUTLS</span><br><span>@@ -109,7 +114,7 @@</span><br><span> #ifndef GRND_NONBLOCK</span><br><span> #define GRND_NONBLOCK 0x0001</span><br><span> #endif /* ifndef GRND_NONBLOCK */</span><br><span style="color: hsl(0, 100%, 40%);">-#endif /* if __GLIBC_PREREQ */</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* ifdef HAVE_GLIBC_GETRANDOM */</span><br><span> #endif /* !EMBEDDED */</span><br><span> </span><br><span> #if (USE_GNUTLS)</span><br><span>@@ -447,7 +452,7 @@</span><br><span>      if (len > OSMO_MAX_RAND_ID_LEN)</span><br><span>                return -E2BIG;</span><br><span> #if (!EMBEDDED)</span><br><span style="color: hsl(0, 100%, 40%);">-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef HAVE_GLIBC_GETRANDOM</span><br><span>       rc = getrandom(out, len, GRND_NONBLOCK);</span><br><span> #elif HAVE_DECL_SYS_GETRANDOM</span><br><span> #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25")</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13209">change 13209</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13209"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id5d577522a4889e152158f7e93ee1c99d3a21003 </div>
<div style="display:none"> Gerrit-Change-Number: 13209 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: supersat <supersat@cs.washington.edu> </div>