Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-31 Thread Jan Friesse
Steve, patch should fulfill that case. regards, Honza Steven Dake napsal(a): _POSIX_MONOTONIC_CLOCK could be defined to -1 which would pass this ifdef test but indicates the feature is not available on the platform. In general the concept is good though. Regards -steve On Thu, 2009-07-30

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-31 Thread Steven Dake
patch looks good for commit regards -steve On Fri, 2009-07-31 at 09:50 +0200, Jan Friesse wrote: Steve, patch should fulfill that case. regards, Honza Steven Dake napsal(a): _POSIX_MONOTONIC_CLOCK could be defined to -1 which would pass this ifdef test but indicates the feature

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-30 Thread Jan Friesse
Steve, what do you think about following patch. No autotools integration, rather one simple #ifdef and warning on compilation. Regards, Honza Steven Dake wrote: After more looking, there is a sysconf test for this (_POSIX_TIMERS). I'm not sure how to do that test inside autotools though.

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-30 Thread Steven Dake
_POSIX_MONOTONIC_CLOCK could be defined to -1 which would pass this ifdef test but indicates the feature is not available on the platform. In general the concept is good though. Regards -steve On Thu, 2009-07-30 at 11:51 +0200, Jan Friesse wrote: Steve, what do you think about following

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-29 Thread Steven Dake
Honza, After more testing, we need the special casing. MacOSX 10.5.7 (latest version) doesn't support clock_gettime. Regards -steve On Mon, 2009-07-27 at 12:13 +0200, Jan Friesse wrote: Committed revision 2373 Steven Dake napsal(a): Patch looks good for commit Regards -steve

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-29 Thread Steven Dake
After more looking, there is a sysconf test for this (_POSIX_TIMERS). I'm not sure how to do that test inside autotools though. Regards -steve On Wed, 2009-07-29 at 18:33 -0700, Steven Dake wrote: Honza, After more testing, we need the special casing. MacOSX 10.5.7 (latest version)

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-27 Thread Jan Friesse
Committed revision 2373 Steven Dake napsal(a): Patch looks good for commit Regards -steve On Thu, 2009-07-23 at 10:09 +0200, Jan Friesse wrote: I hope final version of patch. #ifdefs removed and fixed problem with computing HZ (not used, but may be in future) Regards, Honza

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-26 Thread Steven Dake
Patch looks good for commit Regards -steve On Thu, 2009-07-23 at 10:09 +0200, Jan Friesse wrote: I hope final version of patch. #ifdefs removed and fixed problem with computing HZ (not used, but may be in future) Regards, Honza Steve, We talked about it on IRC Jan Friesse

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-22 Thread Jan Friesse
Steve, new patch included. Steven Dake wrote: In general the patch looks very good. The issues are as follows: 1) corosync_timer_add_absolute expects the expire time to be the nanoseconds since the epoch, or more specifically, from the time(7) man page: The Epoch Unix

Re: [Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-22 Thread Jim Meyering
Jan Friesse wrote: 5) +nano_monotonic_hz = ts.tv_sec + 10ULL / (unsigned long long )ts. BTW, that cast appears to be unnecessary, since the value (ts.tv_nsec, I presume) will be promoted to the width of the other argument to /, which is already ULL. Remember: all casts are bad.

[Openais] [corosync] [patch] - Use clock_gettime for timers

2009-07-21 Thread Jan Friesse
Patch should solve problem with ntp and corosync (what it really does) by using clock_gettime. I tried to find EVERY appearance of gettimeofday and where it makes sense (so basically, where this value is used as timer) convert to call clock_gettime. Patch modifies configure.ac to detect if