UnixOperatingSystem.st
changeset 19913 df79a7806174
parent 19909 77feb88ec876
child 19914 28d41e19cebb
equal deleted inserted replaced
19911:0b24a97a0bb7 19913:df79a7806174
  9178 
  9178 
  9179 # if 1 || !(defined(__GLIBC__) && __GLIBC_PREREQ(2, 23))
  9179 # if 1 || !(defined(__GLIBC__) && __GLIBC_PREREQ(2, 23))
  9180     // getrandom() appears first in GLIBC 2.23
  9180     // getrandom() appears first in GLIBC 2.23
  9181     // but we define it here until this GLIBC has been deployed on all linux distributions
  9181     // but we define it here until this GLIBC has been deployed on all linux distributions
  9182     // used by our customers
  9182     // used by our customers
       
  9183 #  if __POINTER_SIZE__ == 8
       
  9184 #   define __flag32 0
       
  9185 #  else
       
  9186 #   define __flag32 __X32_SYSCALL_BIT
       
  9187 #  endif
  9183 
  9188 
  9184     inline int getrandom(void *buf, size_t buflen, unsigned int flags) {
  9189     inline int getrandom(void *buf, size_t buflen, unsigned int flags) {
  9185         syscall(SYS_getrandom, buf, buflen, flags);   
  9190         syscall(SYS_getrandom|__flag32, buf, buflen, flags);   
  9186     }
  9191     }
  9187 # endif
  9192 # endif
  9188 
  9193 
  9189     size_t wanted, gotSoFar = 0;
  9194     size_t wanted, gotSoFar = 0;
  9190     int cnt;
  9195     int cnt;