Back to index

glibc  2.9
Functions
create_xid.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include <bits/libc-lock.h>
#include <rpc/rpc.h>

Go to the source code of this file.

Functions

 __libc_lock_define_initialized (static, createxid_lock)

Function Documentation

__libc_lock_define_initialized ( static  ,
createxid_lock   
)

Definition at line 28 of file create_xid.c.

{
  long int res;

  __libc_lock_lock (createxid_lock);

  if (!is_initialized)
    {
      struct timeval now;

      __gettimeofday (&now, (struct timezone *) 0);
      __srand48_r (now.tv_sec ^ now.tv_usec, &__rpc_lrand48_data);
      is_initialized = 1;
    }

  lrand48_r (&__rpc_lrand48_data, &res);

  __libc_lock_unlock (createxid_lock);

  return res;
}

Here is the call graph for this function: