lkml.org 
[lkml]   [2024]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7] posix-timers: add clock_compare system call
Date
On Wed, Apr 03 2024 at 15:48, Thomas Gleixner wrote:
> On Tue, Apr 02 2024 at 16:37, Mahesh Bandewar (महेश बंडेवार) wrote:
> It is just an implementation detail whether you use a flag or a
> clockid. You can carry the clockid for the clocks which actually can be
> read in that context in a reserved field of PTP_SYS_OFFSET_EXTENDED:
>
> struct ptp_sys_offset_extended {
> unsigned int n_samples; /* Desired number of measurements. */
> clockid_t clockid;
> unsigned int rsv[2]; /* Reserved for future use. */
> };
>
> and in the IOCTL:
>
> if (extoff->clockid != CLOCK_MONOTONIC_RAW)
> return -EINVAL;

That should obviously be:

switch (extoff->clockid) {
case CLOCK_REALTIME:
case CLOCK_MONOTONIC_RAW:
break;
default:
return -EINVAL;
}

..

> sts.clockid = extoff->clockid;
>
> and it all just works, no?
>
> I have no problem to decide that PTP_SYS_OFFSET will not get this
> treatment and the drivers have to be converted over to
> PTP_SYS_OFFSET_EXTENDED.
>
> But adding yet another callback just to carry a clockid as argument is a
> more than pointless exercise as I demonstrated.
>
> Thanks,
>
> tglx

\
 
 \ /
  Last update: 2024-05-27 16:22    [W:0.080 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site