Solved

Changing BIOS time from C++

Posted on 2002-04-22
1
1,066 Views
Last Modified: 2008-03-04
Dear,

Does someone knows how to alter the hardware time under linux, from C(++) ?

I use the stime function, but this seems to change only the time of the operating system, without changing the real time clock.

Thanks,
Gregory
0
Comment
Question by:Gregory_seifert
1 Comment
 
LVL 4

Accepted Solution

by:
IainHere earned 100 total points
ID: 6963264
The hardware clock would normally be altered using /sbin/hwclock (--systohc I think).  See "man hwclock" for details.

As for calling it from your program,
(A) just call hwclock
(B) hwclock should only be executable by root (of course, any other method to set system clock should also only be usable by root :-).  If this causes problems with your program, redesign your program.  Just out of interest, why do you want to set it programatically?  Sounds like A Bad Idea.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question