OSDN Git Service

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