Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdlib / lcong48.c
blobd1109f0ac304a9851434f3b8c82821afb7156174
1 /*
2 * Copyright (c) 1993 Martin Birgmeier
3 * All rights reserved.
5 * You may redistribute unmodified or modified versions of this source
6 * code provided that the above copyright notice and this and the
7 * following conditions are retained.
9 * This software is provided ``as is'', and comes with no warranties
10 * of any kind. I shall in no event be liable for anything that happens
11 * to anyone/anything when using this software.
14 #include "rand48.h"
16 #ifdef _REENT_THREAD_LOCAL
17 _Thread_local unsigned short _tls_rand48_seed[3] = {_RAND48_SEED_0, _RAND48_SEED_1,
18 _RAND48_SEED_2};
19 _Thread_local unsigned short _tls_rand48_mult[3] = {_RAND48_MULT_0, _RAND48_MULT_1,
20 _RAND48_MULT_2};
21 _Thread_local unsigned short _tls_rand48_add = _RAND48_ADD;
22 #endif
24 void
25 _lcong48_r (struct _reent *r,
26 unsigned short p[7])
28 _REENT_CHECK_RAND48(r);
29 __rand48_seed[0] = p[0];
30 __rand48_seed[1] = p[1];
31 __rand48_seed[2] = p[2];
32 __rand48_mult[0] = p[3];
33 __rand48_mult[1] = p[4];
34 __rand48_mult[2] = p[5];
35 __rand48_add = p[6];
38 #ifndef _REENT_ONLY
39 void
40 lcong48 (unsigned short p[7])
42 _lcong48_r (_REENT, p);
44 #endif /* !_REENT_ONLY */