.. index:: pair: group; Check PTP_SYS_OFFSET ioctl .. _doxid-group__ptp-sys__offset: Check PTP_SYS_OFFSET ioctl ========================== .. toctree:: :hidden: Check that ``PTP_SYS_OFFSET`` ioctl can be used to obtain samples of PTP device time and system time at the same moment. Scenarios: X3-PTP006. #. Find out PTP device associated with the IUT interface, call **open()** to get its FD. #. Call **ioctl** (``PTP_SYS_OFFSET``) on the PTP device FD asking for **n_samples** samples. #. Compute average difference between consecutive pairs of timestamps obtained from ``PTP_SYS_OFFSET``. Check that difference between every such pair is very close to that average. #. Estimate offset between PTP and system clocks with help of two consecutive **clock_gettime()** calls. Check that this estimate is close to the average difference between timestamps pairs obtained from ``PTP_SYS_OFFSET``. Yurij Plotnikov `Yurij.Plotnikov@arknetworks.am `__ .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - env - Testing environment: * :ref:`env.peer2peer ` * - n_samples - How many samples to request from PTP_SYS_OFFSET