Re: C functions to set the linux hardware clock

From: joe durusau (joe.durusau_at_lmco.com)
Date: 03/30/04


Date: Tue, 30 Mar 2004 08:18:06 -0500


flair wrote:

> Hi,
>
> I am programming a software in C language, for Linux. This software
> (running in super-user mode) will have to set the hardware clock.
> Which C functions can I use to adjust the hardware clock?
>
> I have already tried to use the function "settimeofday", but when I
> restart the computer, the time is not saved.
>
> Thanks
> Flair

It's not elegant, but you could always use the ever-popular system()
function to do whatever you wish. Remember, though, that a program
that is suid root can foul up everything with great intensity.

Speaking only for myself,

Joe Durusau