LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2003, 03:48 AM   #1
Mor_Petrus
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
Change RTC with PROC?


Hello

Is it possible to change the RTC (real time clock (system time))
with the proc. Reading it is possible with the command:
cat /proc/driver/rtc
but changing it????

I don't want to use a program like hwclock.

Does somebody know an answer
 
Old 04-15-2003, 12:14 PM   #2
revrendi
LQ Newbie
 
Registered: Mar 2003
Location: California, USA
Distribution: Linux from Scratch
Posts: 9

Rep: Reputation: 0
I'm pretty sure the proc nodes for the RTC are always read only. I have 2.4.3 and 2.4.20 sitting here, and both of them are read only. I'm not 100% sure about the other versions of the kernel. I would expect them to be the same. If all you want to do is programmatically set the clock instead of calling hwclock to do it, just rip out the code from hwclock that does the actual set and put it in your program. All hwclock does is call an ioctl() on the rtc device to set the time. If you're writing a program to do this, that's certainly an option. If you're looking for a text based interface to rtc then you're best bet is either using hwclock or writing something else like it.

I guess you could hack your kernel to make the proc node read/write instead of readonly also. Really depends what your goal is. -- Rev
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Correlation between /proc/devices and /proc/modules ColinLadyka Linux - General 1 02-13-2006 05:25 PM
missing /dev/rtc meres Linux - General 7 10-17-2005 01:37 PM
Change proc value as a user in a script? Brian1 Linux - General 3 01-26-2005 07:57 PM
Proc-rtc HeatSeaker Linux - Software 3 10-31-2004 08:50 AM
How to read the RTC ? oskernel Programming 3 10-17-2003 07:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration