On Thu, Jan 8, 2009 at 10:37 AM, Jay Pipes <[email protected]> wrote:
> MARK CALLAGHAN wrote:
>>>
>>> 1) Is the gettimeofday() function reliable and fast on Solaris? If so,
>>> there really is no need to use gethrtime() here...
>>
>> On some Linux kernels that I have used gettimeofday() fails
>> intermittently for reasons other than those listed in the man page.
>> The code in my_getsystime.c does not check the return value for the
>> getimeofday() call.
>
> Kind of. It uses the following, possibly infinite loop: :(
Pardon my ambiguity. I was referring to MySQL source where checking
for errors on system calls is optional. I expect Drizzle to do the
right thing -- :)
>
> uint64_t newtime;
> struct timeval t;
> /*
> The following loop is here because gettimeofday may fail on some systems
> */
> while (gettimeofday(&t, NULL) != 0)
> {}
> *time_arg= t.tv_sec;
> newtime= (uint64_t)t.tv_sec * 1000000 + t.tv_usec;
> return newtime;
>
> -jay
>
--
Mark Callaghan
[email protected]
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp