Real Time Clock on Red Hat Linux Hangs on Read (from /dev/rtc) 
Author Message
 Real Time Clock on Red Hat Linux Hangs on Read (from /dev/rtc)

> How can keep the below program to work correctly?

As you know from your following the newsgroup, questions about platform-
specific issues are not topical on comp.lang.c. I assume you did follow the
newsgroup and check the FAQ before posting, since that's what human beings
do.  Occasionally, some Windows faddist will accuse us of being unixites,
enforcing this only against their benighted religion, letting unix
questions go unchallenged.  This is a myth.  The following are indications
that you need to take this to some where that Red Hat, or Linux, or Unix is

> #include <linux/mc146818rtc.h>
> #include <sys/ioctl.h>
> #include <fcntl.h>
>   struct rtc_time rtc_tm;
>   fd = open ("/dev/rtc", O_RDONLY);
>   retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
>   retval = read (fd,&data,sizeof(unsigned long));
>   close(fd);

None of the above headers, structures, or functions exist in C.

>     exit(errno);

This, which occurs several places, has no known standard meaning in C
unless errno has been set to one of 0, EXIT_SUCCESS, or EXIT_FAILURE.  But
you didn't include <stdlib.h>, so that is unlikely.

Martin Ambuhl
now exiled to
Hurricane Bait, Texas

Tue, 29 Nov 2005 21:02:37 GMT  
 Real Time Clock on Red Hat Linux Hangs on Read (from /dev/rtc)

> How can keep the below program to work correctly?

If you want to keep it to wort the way it is, simply don't change it.
If you meant that it is not working as it is supposed to and you are
looking for a sollution that works as it is supposed to, you need to
specify what it is supposed to do.

Now your program is out of the scope of this newsgroup as it does not
conform to standard C, but uses platform specific code. Please tak your
question to a newsgroup tha discusses programming for your platform.
I'ld suggest comp.os.linux.development.apps.

[snipped platform specific code]

"LISP  is worth learning for  the profound enlightenment  experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days."   -- Eric S. Raymond

Tue, 29 Nov 2005 21:02:10 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Get Real Time Clock (RTC) time/date

2. Real Time Clock (RTC) in C/C++

3. LOCAL -Boston, MA- BLU.ORG - 05/19/99: CodeWarrior for Red Hat Linux

4. No zero padding in printf - Red Hat Linux 4.2 and OSF

5. Q: update system clock with real time clock

6. RTC(Real Time Communications) app.

7. Using RTC(Real-Time Communication) COM in WindowsCE

8. problems with lseek (2) system call on red hat 9

9. Red Hat 5.2

10. real time clock

11. Help with real time clock

12. Real time clock function needed


Powered by phpBB® Forum Software