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