bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] Re: gettimeofday() for Win32


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: gettimeofday() for Win32
Date: Tue, 23 May 2006 14:32:14 +0200
User-agent: KMail/1.5

Hi,

Thanks for improving the gettimeofday replacement.

> +# if HAVE__FTIME
> +
> +  struct _timeb timebuf;
> +  
> +  _ftime (&timebuf);
> +  tv->tv_sec = timebuf.time;
> +  tv->tv_usec = timebuf.millitm * 1000;
> +
> +  return 0;
> +

Similar things should be done for systems that have no gettimeofday()
but do have an 'ftime' function and 'struct timeb' declared in
<sys/timeb.h>. (Old SysVR2 or SysVR3 systems. Microsoft did not invent this
interface; they only prepended the underscore.)

> +  AC_CACHE_CHECK([for gettimeofday whose signature conforms to POSIX],

What's the point of checking the signature? The only signatures of
gettimeofday() I've seen are:

    int gettimeofday (struct timeval * tp, ...);
    int gettimeofday (struct timeval * tp, struct timezone *tzp);
    int gettimeofday (struct timeval * tp, void *tzp);

and they are all OK with the usual way to call it.

>  Include:
>  <sys/time.h>
> +"gettimeofday.h"

Please put only one header here. If we provide a gettimeofday.h file, it
should be self-contained. In other words, I would #include <sys/time.h>
inside gettimeofday.h.

Bruno





reply via email to

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