Back to index

glibc  2.9
Functions
seed48_r.c File Reference
#include <stdlib.h>
#include <string.h>
#include <limits.h>

Go to the source code of this file.

Functions

int __seed48_r (seed16v, struct drand48_data *buffer)

Function Documentation

int __seed48_r ( seed16v  ,
struct drand48_data *  buffer 
)

Definition at line 25 of file seed48_r.c.

{
  /* Save old value at a private place to be used as return value.  */
  memcpy (buffer->__old_x, buffer->__x, sizeof (buffer->__x));

  /* Install new state.  */
  buffer->__x[2] = seed16v[2];
  buffer->__x[1] = seed16v[1];
  buffer->__x[0] = seed16v[0];
  buffer->__a = 0x5deece66dull;
  buffer->__c = 0xb;
  buffer->__init = 1;

  return 0;
}