This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] clock_settime
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 9 May 2011 10:16:07 +0200
- Subject: Re: [PATCH] clock_settime
- References: <BANLkTikgd2eKVtG2gVTktwB8zbwn=9awtg@mail.gmail.com>
- Reply-to: cygwin-patches at cygwin dot com
Hi Yaakov,
On May 8 17:48, Yaakov (Cygwin/X) wrote:
> This implements the POSIX clock_settime function, on top of settimeofday:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_settime.html
> http://www.kernel.org/doc/man-pages/online/pages/man3/clock_gettime.3.html
> http://www.kernel.org/doc/man-pages/online/pages/man2/settimeofday.2.html
>
> The fixes to settimeofday are necessary both to match BSD and Linux behaviour,
> and to provide the errnos and return status for clock_settime required by POSIX.
> I also fixed posix.sgml WRT clock_setres.
>
> Patches for winsup/cygwin and winsup/doc, plus test programs for both
> functions, attached.
Thanks for the patch.
> Index: times.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/times.cc,v
> retrieving revision 1.107
> diff -u -r1.107 times.cc
> --- times.cc 2 May 2011 15:28:35 -0000 1.107
> +++ times.cc 8 May 2011 17:55:34 -0000
> @@ -111,6 +111,12 @@
>
> tz = tz; /* silence warning about unused variable */
>
> + if (tv->tv_usec < 0 || tv->tv_usec >= 1000000)
Not your fault, but what I'm missing in settimeofday is an EFAULT handler.
Could you please add one, just like in the times() function a couple of
lines earlier? The `tz = tz;' line can go away, the usage is covered
by the syscall_printf at the end of the function.
Other than that, please apply.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat