Back to index

glibc  2.9
Functions
tst-random2.c File Reference
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 25 of file tst-random2.c.

{
  int pass;
  int ret = 0;
  long int r[2];

  for (pass = 0; pass < 2; pass++)
    {
      srandom (0x12344321);

      int j;
      for (j = 0; j < 3; ++j)
       random ();
      if (pass == 1)
       {
         char state[128];
         char *ostate = initstate (0x34562101, state, 128);
         if (setstate (ostate) != state)
           {
             puts ("setstate (ostate) != state");
             ret = 1;
           }
       }

      random ();
      r[pass] = random ();
    }

  if (r[0] != r[1])
    {
      printf ("%ld != %ld\n", r[0], r[1]);
      ret = 1;
    }
  return ret;
}

Here is the call graph for this function: