mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 02:15:07 -05:00
refclock_phc: open device for writing with extpps option
In version 6.15 the Linux kernel started checking write access on the PHC file descriptor in the PTP_PIN_SETFUNC and PTP_EXTTS_REQUEST ioctls. chronyd opened the PHC device as readonly, which caused the PHC refclock driver configured with the extpps option to fail with the "Could not enable external PHC timestamping" error message. To ensure compatibility with new kernel versions, add flags to the SYS_Linux_OpenPHC() function and open the device with the O_RDWR flag when the extpps option is enabled.
This commit is contained in:
@@ -39,7 +39,7 @@ extern void SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext conte
|
||||
|
||||
extern int SYS_Linux_CheckKernelVersion(int req_major, int req_minor);
|
||||
|
||||
extern int SYS_Linux_OpenPHC(const char *device);
|
||||
extern int SYS_Linux_OpenPHC(const char *device, int flags);
|
||||
|
||||
extern int SYS_Linux_GetPHCReadings(int fd, int nocrossts, int *reading_mode, int max_readings,
|
||||
struct timespec tss[][3]);
|
||||
|
||||
Reference in New Issue
Block a user