#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Tue, 31 May 2016 11:44:52 +0200
changeset 19913 df79a7806174
parent 19911 0b24a97a0bb7
child 19914 28d41e19cebb
#BUGFIX by stefan class: UnixOperatingSystem changed: #randomBytesInto: fix for 32-bit linux
UnixOperatingSystem.st
--- a/UnixOperatingSystem.st	Mon May 30 18:18:57 2016 +0200
+++ b/UnixOperatingSystem.st	Tue May 31 11:44:52 2016 +0200
@@ -9180,9 +9180,14 @@
     // getrandom() appears first in GLIBC 2.23
     // but we define it here until this GLIBC has been deployed on all linux distributions
     // used by our customers
+#  if __POINTER_SIZE__ == 8
+#   define __flag32 0
+#  else
+#   define __flag32 __X32_SYSCALL_BIT
+#  endif
 
     inline int getrandom(void *buf, size_t buflen, unsigned int flags) {
-        syscall(SYS_getrandom, buf, buflen, flags);   
+        syscall(SYS_getrandom|__flag32, buf, buflen, flags);   
     }
 # endif