mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 18:35:06 -05:00
sys: add null driver
Add a new clock driver that doesn't actually try to adjust the clock. It allows chronyd to run without the capability to adjust/set the system clock, e.g. in some containers. It can be enabled by the -x option.
This commit is contained in:
16
sys.c
16
sys.c
@@ -30,6 +30,7 @@
|
||||
#include "sysincl.h"
|
||||
|
||||
#include "sys.h"
|
||||
#include "sys_null.h"
|
||||
#include "logging.h"
|
||||
|
||||
#if defined(LINUX)
|
||||
@@ -44,9 +45,18 @@
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static int null_driver;
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SYS_Initialise(void)
|
||||
SYS_Initialise(int clock_control)
|
||||
{
|
||||
null_driver = !clock_control;
|
||||
if (null_driver) {
|
||||
SYS_Null_Initialise();
|
||||
return;
|
||||
}
|
||||
#if defined(LINUX)
|
||||
SYS_Linux_Initialise();
|
||||
#elif defined(SOLARIS)
|
||||
@@ -65,6 +75,10 @@ SYS_Initialise(void)
|
||||
void
|
||||
SYS_Finalise(void)
|
||||
{
|
||||
if (null_driver) {
|
||||
SYS_Null_Finalise();
|
||||
return;
|
||||
}
|
||||
#if defined(LINUX)
|
||||
SYS_Linux_Finalise();
|
||||
#elif defined(SOLARIS)
|
||||
|
||||
Reference in New Issue
Block a user