OK, I dug through some code. It looks like it is possible to set CLOCK_REALTIME? I tried to trace clock_settime(). There are a bunch of different calls that seem to happen. Some that get translated through syscall. Anyway, I found this, and it seems to suggest that it is possible to set CLOCK_REALTIME. Is the documentation incorrect, or am I tricking myself into thinking I can set the CLOCK_REALTIME??
-Rob In xenomai-2.4-rc4/ksrc/skins/posix/clock.c: 137 /** 138 * Set the specified clock. 139 * 140 * This allow setting the CLOCK_REALTIME clock. 141 * 142 * @param clock_id, the id of the clock to be set, only CLOCK_REALTIME is 143 * supported. 144 * 145 * @param tp, the address of a struct timespec specifying the new date. 146 * 147 * @retval 0 on success; 148 * @retval -1 with @a errno set if: 149 * - EINVAL, @a clock_id is not CLOCK_REALTIME; 150 * - EINVAL, the date specified by @a tp is invalid. 151 * 152 * @see 153 * <a href=" http://www.opengroup.org/onlinepubs/000095399/functions/clock_settime.html"> 154 * Specification.</a> 155 * 156 */ 157 int clock_settime(clockid_t clock_id, const struct timespec *tp) On 11/9/07, Robert Gubler <[EMAIL PROTECTED]> wrote: > > Hello, > > I'd like to synchronize CLOCK_REALTIME between some computers that share > an Ethernet switch. I am using RTNet as my networking stack. My approach > right now is very simplistic. I have a central server that will be sending > out one 1 packet per second, with its struct timespec it got as a result of > calling clock_gettime(CLOCK_REALTIME,...). The computers listening for this > packet would then call clock_settime(CLOCK_REALTIME,..). > > In the Xenomai POSIX skin API doc it says clock_settime() isn't > supported. Is there a recommended approach to accomplishing this? I am > using Xenomai 2.4-rc4. > > -Rob >
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
