LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-06-2011, 05:07 AM   #1
swapnildixit
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
RTC_SET_TIME is not working


My RTC_SET_TIME is not working with current month december. I am passing all the required values like year, month, day, hour, minutes, seconds with in a structure to ioctl RTC_SET_TIME.
retval = ioctl(fd, RTC_SET_TIME, &set_rtc_tm);
if (retval == -1)
{
printf("\nRTC set time IOCTL Fail\n");
return RTC_FAIL;
}
 
Old 12-07-2011, 11:42 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
You are missing two things:

1) Just above this you called fd = open(...). Please tell me that you checked fd != -1.

2) Change: printf("\nRTC set time IOCTL Fail\n");
to: perror("\nRTC set time IOCTL Fail");

This will print a more useful indication than "not working". Are you running this as root?
 
  


Reply



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
RTC_SET_TIME is not working swapnildixit Linux - Embedded & Single-board computer 2 12-06-2011 08:35 AM
[SOLVED] Wifi not working in Eee PPC 1000HE (Debian Squeeze), but ethernet is working someshpr Linux - Laptop and Netbook 8 10-10-2011 03:59 PM
SED - minor changes work - Larger doesn't (working and non working code included) Nimoy Programming 17 09-22-2007 04:34 PM
Fortemedia FM801 card not working under FC5 on Intel 845 but working with windows morningkiran Linux - Hardware 0 11-30-2006 07:57 AM
acpi nearly working IBM thinkpad R40e 2684HVG no Fn key working, throttling OK Emmanuel_uk Linux - Laptop and Netbook 2 05-31-2006 01:41 AM

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

All times are GMT -5. The time now is 01:14 AM.

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