lcong48.c 717 B

1234567891011121314151617181920212223242526272829
  1. /* vi: set sw=4 ts=4: */
  2. /* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */
  3. #include <features.h>
  4. #if defined __USE_SVID || defined __USE_XOPEN
  5. #include <stdint.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8. static int __lcong48_r (unsigned short int param[7], struct drand48_data *buffer)
  9. {
  10. /* Store the given values. */
  11. memcpy (buffer->__x, &param[0], sizeof (buffer->__x));
  12. buffer->__a = ((uint64_t) param[5] << 32 | (uint32_t) param[4] << 16 | param[3]);
  13. buffer->__c = param[6];
  14. buffer->__init = 1;
  15. return 0;
  16. }
  17. # ifdef __USE_MISC
  18. strong_alias(__lcong48_r,lcong48_r)
  19. # endif
  20. void lcong48 (unsigned short int param[7])
  21. {
  22. (void) __lcong48_r (param, &__libc_drand48_data);
  23. }
  24. #endif