Setting the hardware clock from code.

Greetings,

Does anyone know how to save the time to the clock hardware in code? That
is, I’m looking for code that will do the equivalent of rtc -s hw.

The platform is NTO.

]{ristoph