bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettimeofday() for Win32


From: Martin Lambers
Subject: Re: gettimeofday() for Win32
Date: Fri, 2 Sep 2005 08:31:26 +0200
User-agent: Mutt/1.5.6+20040907i

On Thu, 25. Aug 2005, 19:36:23 +0200, Jim Meyering wrote:
> Paul Eggert <address@hidden> wrote:
> > I suspect that he'll say it's OK with him as long as it's no real work
> > for him.
> 
> That's accurate :)

Then I'd like to propose the following two patches for inclusion.

The first is a revision of my previous patch. It was tested in the
following environments:

1. GNU/Linux host 
   (working gettimeofday)
2. W32 host, cross-compiled with Debian mingw32 package 
   (no gettimeofday)
3. GNU/Linux host with a broken gettimeofday, simulated by 
   LD_PRELOADing a gettimeofday function that does nothing more than
   clobber the localtime buffer.
4. NetBSD host, cross-compiled from a GNU/Linux host
   (has a working gettimeofday, but configure must assume a broken
   gettimeofday because the test program cannot run)

In all cases, the configuration step behaved as expected, and
test-gettimeofday.c compiled and ran fine on the appropriate host.

The patch is mostly a recombination of code written by Jim Meyering and
Bruno Haible, so there should by no copyright problem when including
this into gnulib.

The second patch makes the gettime module use gettimeofday
unconditionally. It depended on the gettimeofday module before, and
this small change
- simplifies the code
- improves gettime time resolution from seconds to microseconds on W32.

Other modules that use gettimeofday are gethrxtime, tempname, and
mkdtemp. None of these would benefit from depending on the gettimeofday
module as far as I can see.

Regards,
Martin

Attachment: gettimeofday.patch
Description: Text document

Attachment: gettime-gettimeofday.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]