[pypy-commit] pypy release-pypy2.7-5.x: Support translation with older Linux kernel headers
arigo
pypy.commits at gmail.com
Sun Apr 2 15:46:31 EDT 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: release-pypy2.7-5.x
Changeset: r90929:c8a8072b284d
Date: 2017-03-20 23:32 +0100
http://bitbucket.org/pypy/pypy/changeset/c8a8072b284d/
Log: Support translation with older Linux kernel headers
diff --git a/rpython/rlib/rurandom.py b/rpython/rlib/rurandom.py
--- a/rpython/rlib/rurandom.py
+++ b/rpython/rlib/rurandom.py
@@ -99,8 +99,11 @@
eci = eci.merge(ExternalCompilationInfo(includes=['linux/random.h']))
class CConfig:
_compilation_info_ = eci
- GRND_NONBLOCK = rffi_platform.ConstantInteger('GRND_NONBLOCK')
+ GRND_NONBLOCK = rffi_platform.DefinedConstantInteger(
+ 'GRND_NONBLOCK')
globals().update(rffi_platform.configure(CConfig))
+ if GRND_NONBLOCK is None:
+ GRND_NONBLOCK = 0x0001 # from linux/random.h
# On Linux, use the syscall() function because the GNU libc doesn't
# expose the Linux getrandom() syscall yet.
More information about the pypy-commit
mailing list