#include #include #include int main( void ) { int value; if ( ioperm( 0x70, 2, 1 ) ) { perror( "Error" ); fprintf( stderr, "You must be root to run this program.\n" ); return 1; } fprintf( stderr, "Restarting RTC clock...\n" ); outb( 0xb, 0x70 ); value = inb( 0x71 ); value |= 0x80; outb( 0xb, 0x70 ); outb( value, 0x71 ); sleep( 2 ); value &= 0x7f; outb( 0xb, 0x70 ); outb( value, 0x71 ); return 0; }