155714Skris/*
255714Skris * Copyright (c) 1993 Martin Birgmeier
355714Skris * All rights reserved.
455714Skris *
555714Skris * You may redistribute unmodified or modified versions of this source
655714Skris * code provided that the above copyright notice and this and the
755714Skris * following conditions are retained.
855714Skris *
955714Skris * This software is provided ``as is'', and comes with no warranties
1055714Skris * of any kind. I shall in no event be liable for anything that happens
1155714Skris * to anyone/anything when using this software.
1255714Skris */
1355714Skris
1455714Skris#include <sys/cdefs.h>
1555714Skris__FBSDID("$FreeBSD: stable/11/lib/libc/gen/mrand48.c 310319 2016-12-20 07:42:15Z ed $");
1655714Skris
1755714Skris#include <stdint.h>
1855714Skris
1955714Skris#include "rand48.h"
20
21extern unsigned short _rand48_seed[3];
22
23long
24mrand48(void)
25{
26
27	_dorand48(_rand48_seed);
28	return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) |
29	    (uint32_t)_rand48_seed[1]));
30}
31