Solved

Changing BIOS time from C++

Posted on 2002-04-22
1
1,054 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux , how can I inspect a tar GZ file 3 131
mysql server issue in linux server 5 59
What is the timeframe of this cron job? 2 131
Cron jobs 12 121
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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now