OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [compat/] [gettod.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * gettod.c --
3
 *
4
 *      This file provides the gettimeofday function on systems
5
 *      that only have the System V ftime function.
6
 *
7
 * Copyright (c) 1995 Sun Microsystems, Inc.
8
 *
9
 * See the file "license.terms" for information on usage and redistribution
10
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
 *
12
 * RCS: @(#) $Id: gettod.c,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
13
 */
14
 
15
#include "tcl.h"
16
#include "tclPort.h"
17
#include <sys/timeb.h>
18
 
19
#undef timezone
20
 
21
int
22
gettimeofday(tp, tz)
23
struct timeval *tp;
24
struct timezone *tz;
25
{
26
    struct timeb t;
27
    ftime(&t);
28
    tp->tv_sec = t.time;
29
    tp->tv_usec = t. millitm * 1000;
30
    return 0;
31
}
32
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.