/*
 *  session.c -- セッションIDを計算する
 *
 *	0.0: May  18, 2020 by Dai ISHIJIMA
 */

#include <stdio.h>
#include <time.h>
#include <sys/time.h>

int main()
{
    struct timeval t;
    unsigned long sec, usec;
    unsigned long id;
    
    gettimeofday(&t, NULL);
    /*                    01234567 */
    sec  = (t.tv_sec  & 0xffffffff);
    usec = (t.tv_usec & 0xffffffff);
    id = sec ^ usec;
    printf("%d\n", sec);
    printf("%04x:%04x\n", id & 0xffff, (id & 0xffff0000) >> 16);
    exit(0);
}

/* Local Variables: */
/* compile-command:"cc -Wall -O -static -o session session.c" */
/* End: */

	
