bug-gnulib
[Top][All Lists]
Advanced

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

Re: Status of the win32 gettimeofday module


From: Bruno Haible
Subject: Re: Status of the win32 gettimeofday module
Date: Wed, 17 Jan 2007 12:47:38 +0100
User-agent: KMail/1.9.1

The revised gettimeofday module requires IMO the following changes in
gnulib. Opinions? Paul?


--- lib/gettime.c       13 Sep 2006 22:38:14 -0000      1.7
+++ lib/gettime.c       17 Jan 2007 11:48:37 -0000
@@ -1,6 +1,6 @@
 /* gettime -- get the system clock
 
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,6 +22,8 @@
 
 #include "timespec.h"
 
+#include "gettimeofday.h"
+
 /* Get the system time into *TS.  */
 
 void
--- lib/tempname.c      9 Nov 2006 18:49:46 -0000       1.23
+++ lib/tempname.c      17 Jan 2007 11:48:37 -0000
@@ -1,7 +1,7 @@
 /* tempname.c - generate the name of a temporary file.
 
    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@
 # define small_open __open
 # define large_open __open64
 #else
+# include "gettimeofday.h"
 # define struct_stat64 struct stat
 # define small_open open
 # define large_open open
@@ -242,15 +243,11 @@
 #ifdef RANDOM_BITS
   RANDOM_BITS (random_time_bits);
 #else
-# if HAVE_GETTIMEOFDAY || _LIBC
   {
     struct timeval tv;
     __gettimeofday (&tv, NULL);
     random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
   }
-# else
-  random_time_bits = time (NULL);
-# endif
 #endif
   value += random_time_bits ^ __getpid ();
 
--- modules/tempname    14 Nov 2006 14:12:03 -0000      1.2
+++ modules/tempname    17 Jan 2007 11:48:37 -0000
@@ -10,6 +10,7 @@
 extensions
 stdint
 sys_stat
+gettimeofday
 
 configure.ac:
 gl_FUNC_GEN_TEMPNAME



and the following change to coreutils. Jim?

--- src/ls.c    2 Jan 2007 06:29:12 -0000       1.447
+++ src/ls.c    17 Jan 2007 11:48:56 -0000
@@ -85,6 +85,7 @@
 #include "dirfd.h"
 #include "error.h"
 #include "filenamecat.h"
+#include "gettimeofday.h"
 #include "hard-locale.h"
 #include "hash.h"
 #include "human.h"
@@ -3221,17 +3222,12 @@
      future merely because their time stamps have higher resolution
      than the clock resolution.  */
 
-#if HAVE_GETTIMEOFDAY
   {
     struct timeval timeval;
     gettimeofday (&timeval, NULL);
     current_time = timeval.tv_sec;
     current_time_ns = timeval.tv_usec * 1000 + 999;
   }
-#else
-  current_time = time (NULL);
-  current_time_ns = 999999999;
-#endif
 }
 
 /* Print the user or group name NAME, with numeric id ID, using a




reply via email to

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