os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/compat/gettod.c
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/* 
sl@0
     2
 * gettod.c --
sl@0
     3
 *
sl@0
     4
 *	This file provides the gettimeofday function on systems
sl@0
     5
 *	that only have the System V ftime function.
sl@0
     6
 *
sl@0
     7
 * Copyright (c) 1995 Sun Microsystems, Inc.
sl@0
     8
 *
sl@0
     9
 * See the file "license.terms" for information on usage and redistribution
sl@0
    10
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
sl@0
    11
 *
sl@0
    12
 * RCS: @(#) $Id: gettod.c,v 1.2 1998/09/14 18:39:44 stanton Exp $
sl@0
    13
 */
sl@0
    14
sl@0
    15
#include "tcl.h"
sl@0
    16
#include "tclPort.h"
sl@0
    17
#include <sys/timeb.h>
sl@0
    18
sl@0
    19
#undef timezone
sl@0
    20
sl@0
    21
int
sl@0
    22
gettimeofday(tp, tz)
sl@0
    23
struct timeval *tp;
sl@0
    24
struct timezone *tz;
sl@0
    25
{
sl@0
    26
    struct timeb t;
sl@0
    27
    ftime(&t);
sl@0
    28
    tp->tv_sec = t.time;
sl@0
    29
    tp->tv_usec = t. millitm * 1000;
sl@0
    30
    return 0;
sl@0
    31
}
sl@0
    32