Author: Armin Rigo <[email protected]>
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.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit