aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/aix/gettimeofday.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/aix/gettimeofday.c')
-rw-r--r--sysdeps/unix/sysv/aix/gettimeofday.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sysdeps/unix/sysv/aix/gettimeofday.c b/sysdeps/unix/sysv/aix/gettimeofday.c
index c7a4a01c08..031a84ebb6 100644
--- a/sysdeps/unix/sysv/aix/gettimeofday.c
+++ b/sysdeps/unix/sysv/aix/gettimeofday.c
@@ -21,11 +21,14 @@
#include <sys/time.h>
#ifndef HAVE_GNU_LD
-#define __daylight daylight
-#define __timezone timezone
-#define __tzname tzname
+# define __daylight daylight
+# define __timezone timezone
+# define __tzname tzname
#endif
+extern int rtc_upper (void);
+extern int rtc_lower (void);
+
/* Assembler Routines to access the timer registers */
asm("
.rtc_upper: mfspr 3,4 # copy RTCU to return register
@@ -51,14 +54,14 @@ __gettimeofday (tv, tz)
return -1;
}
- ts = rtc_upper(); /* seconds */
- tl = rtc_lower(); /* nanoseconds */
- tu = rtc_upper(); /* Check for a carry from */
- if (ts != tu) /* the lower reg to the upper */
- tl = rtc_lower(); /* Recover from the race condition */
+ ts = rtc_upper (); /* Seconds. */
+ tl = rtc_lower (); /* Nanoseconds. */
+ tu = rtc_upper (); /* Check for a carry from. */
+ if (ts != tu) /* The lower reg to the upper. */
+ tl = rtc_lower (); /* Recover from the race condition. */
- tv->tv_sec = (long int) (tu + (double)tl/1000000000);
- tv->tv_usec = (long int) ((double)tl/1000);
+ tv->tv_sec = (long int) (tu + (double) tl / 1000000000);
+ tv->tv_usec = (long int) ((double) tl / 1000);
if (tz != NULL)
{