~ubuntu-branches/ubuntu/raring/tcl8.5/raring

« back to all changes in this revision

Viewing changes to compat/gettod.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2007-10-26 22:04:32 UTC
  • Revision ID: james.westby@ubuntu.com-20071026220432-57je4z35i4ll6uit
Tags: upstream-0.b2
ImportĀ upstreamĀ versionĀ 0.b2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
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.4 2007/04/16 13:36:34 dkf Exp $
 
13
 */
 
14
 
 
15
#include "tclPort.h"
 
16
#include <sys/timeb.h>
 
17
 
 
18
#undef timezone
 
19
 
 
20
int
 
21
gettimeofday(
 
22
    struct timeval *tp,
 
23
    struct timezone *tz)
 
24
{
 
25
    struct timeb t;
 
26
 
 
27
    ftime(&t);
 
28
    tp->tv_sec = t.time;
 
29
    tp->tv_usec = t. millitm * 1000;
 
30
    return 0;
 
31
}
 
32