/* Auzug aus ext/standard/lg.c, gekürzt um einige IFDEFs */

static void lcg_seed(TSRMLS_D) 
{
    struct timeval tv;
    if (gettimeofday(&tv, NULL) == 0) {
            LCG(s1) = tv.tv_sec ^ (tv.tv_usec<<11);
    } else {
            LCG(s1) = 1;
    }
    LCG(s2) = (long) getpid();
    /* Add entropy to s2 by calling gettimeofday() again */
    if (gettimeofday(&tv, NULL) == 0) {
            LCG(s2) ^= (tv.tv_usec<<11);
    }
    LCG(seeded) = 1;
}