Re: [Linuxptp-users] clock_nanosleep on /dev/ptpX (2022)
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2022-10-02 02:13:58
|
On Sat, Oct 01, 2022 at 10:10:37AM -0700, todd freed wrote: > I gather from the ENOTSUPP return that it's also not implemented > today. I'm running linux 5.19.7. Just wanted confirmation on that > point? Correct. Will not ever happen. Big can of worms. > I could run phc2sys on these hosts and then sleep against > CLOCK_MONOTONIC. But I had wanted to avoid that, simply because some > of the devices (desktop pcs) are being used for things other than this > specific application, and I'd not like to takeover the systemwide > clock. If you really can't/won't use phc2sys, then you can also do clock_gettime(CLOCK_MONOTONIC, t1); clock_gettime(phc, t2); clock_gettime(CLOCK_MONOTONIC, t3); and calculate offset = ((t3 - t1) / 2) - t2 every once in a while, then use linear interpolation to convert deadlines from the PHC time scale into monotonic deadlines. HTH, Richard |