summaryrefslogtreecommitdiff
path: root/ace/OS_NS_time.inl
diff options
context:
space:
mode:
Diffstat (limited to 'ace/OS_NS_time.inl')
-rw-r--r--ace/OS_NS_time.inl23
1 files changed, 14 insertions, 9 deletions
diff --git a/ace/OS_NS_time.inl b/ace/OS_NS_time.inl
index b9243532d15..fbce238b080 100644
--- a/ace/OS_NS_time.inl
+++ b/ace/OS_NS_time.inl
@@ -1,4 +1,5 @@
// -*- C++ -*-
+//
// $Id$
#include "ace/OS_NS_string.h"
@@ -8,6 +9,8 @@
#include "ace/OS_NS_sys_time.h"
//#include "ace/TSS_T.h"
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
ACE_INLINE char *
ACE_OS::asctime (const struct tm *t)
{
@@ -223,7 +226,7 @@ ACE_OS::difftime (time_t t1, time_t t0)
#endif /* ! ACE_LACKS_DIFFTIME */
#if defined (ghs) && defined (ACE_HAS_PENTIUM) && !defined (ACE_WIN32)
- extern "C" ACE_hrtime_t ACE_gethrtime ();
+ extern "C" ACE_hrtime_t ACE_GETHRTIME_NAME ();
#endif /* ghs && ACE_HAS_PENTIUM */
ACE_INLINE ACE_hrtime_t
@@ -244,7 +247,7 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
#elif defined (ghs) && defined (ACE_HAS_PENTIUM) && !defined (ACE_WIN32)
ACE_UNUSED_ARG (op);
// Use .obj/gethrtime.o, which was compiled with g++.
- return ACE_gethrtime ();
+ return ACE_GETHRTIME_NAME ();
#elif (defined(__KCC) || defined (__GNUG__) || defined (__INTEL_COMPILER)) && !defined (ACE_WIN32) && !defined(ACE_VXWORKS) && defined (ACE_HAS_PENTIUM)
ACE_UNUSED_ARG (op);
# if defined (ACE_LACKS_LONGLONG_T)
@@ -364,7 +367,12 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op)
ACE_UNUSED_ARG (op);
struct timespec ts;
- ACE_OS::clock_gettime (CLOCK_REALTIME, &ts);
+ ACE_OS::clock_gettime (
+#if defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
+ CLOCK_MONOTONIC,
+#endif /* !ACE_HAS_CLOCK_GETTIME_MONOTONIC */
+ CLOCK_REALTIME,
+ &ts);
// Carefully create the return value to avoid arithmetic overflow
// if ACE_hrtime_t is ACE_U_LongLong.
@@ -483,13 +491,8 @@ ACE_OS::nanosleep (const struct timespec *requested,
ACE_UNUSED_ARG (remaining);
// Convert into seconds and microseconds.
-# if ! defined(ACE_HAS_BROKEN_TIMESPEC_MEMBERS)
- ACE_Time_Value tv (static_cast<long>(requested->tv_sec),
+ ACE_Time_Value tv (requested->tv_sec,
requested->tv_nsec / 1000);
-# else
- ACE_Time_Value tv (requested->ts_sec,
- requested->ts_nsec / 1000);
-# endif /* ACE_HAS_BROKEN_TIMESPEC_MEMBERS */
return ACE_OS::sleep (tv);
#endif /* ACE_HAS_CLOCK_GETTIME */
}
@@ -562,3 +565,5 @@ ACE_OS::tzset (void)
# endif /* ACE_HAS_WINCE && !VXWORKS && !ACE_PSOS && !__rtems__ && !ACE_HAS_DINKUM_STL */
}
+
+ACE_END_VERSIONED_NAMESPACE_DECL