/* -*- C++ -*- */ // $Id$ // ============================================================================ // // = LIBRARY // ace // // = FILENAME // OS.h // // = AUTHOR // Doug Schmidt , Jesper S. M|ller // , and a cast of thousands... // // ============================================================================ #if !defined (ACE_OS_H) #define ACE_OS_H // This file should be a link to the platform/compiler-specific // configuration file (e.g., config-sunos5-sunc++-4.x.h). #include "ace/config.h" // Deal with MSVC++ insanity for CORBA... #if defined (ACE_WIN32) && !defined (ACE_ORBIX_HAS_NAMESPACES) #define ACE_CORBA_1(NAME) CORBA_##NAME #define ACE_CORBA_2(TYPE, NAME) CORBA_##TYPE##_##NAME #define ACE_CORBA_3(TYPE, NAME) CORBA_##TYPE##::##NAME #define ACE_NESTED_CLASS(TYPE, NAME) NAME #else #define ACE_CORBA_1(NAME) CORBA::##NAME #define ACE_CORBA_2(TYPE, NAME) CORBA::##TYPE##::##NAME #define ACE_CORBA_3(TYPE, NAME) CORBA::##TYPE##::##NAME #define ACE_NESTED_CLASS(TYPE, NAME) TYPE::##NAME #endif /* ACE_WIN32 */ // Define some helpful macros. #define ACE_ONE_SECOND_IN_MSECS 1000L #define ACE_ONE_SECOND_IN_USECS 1000000L #define ACE_ONE_SECOND_IN_NSECS 1000000000L #if defined (ACE_NO_INLINE) // ACE inlining has been explicitly disabled. Implement // internally within ACE by undefining __ACE_INLINE__. # undef __ACE_INLINE__ #endif /* ! ACE_NO_INLINE */ // The maximum length for a fully qualified Internet name. #if !defined(ACE_MAX_FULLY_QUALIFIED_NAME_LEN) #define ACE_MAX_FULLY_QUALIFIED_NAME_LEN 256 #endif /* ACE_MAX_FULLY_QUALIFIED_NAME_LEN */ #if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) // control message size to pass a file descriptor #define ACE_BSD_CONTROL_MSG_LEN sizeof (struct cmsghdr) + sizeof (ACE_HANDLE) #endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ // Define the default constants for ACE. Many of these are used for // the ACE tests and applications. You can change these values by // defining the macros in your config.h file. #if !defined (ACE_DEFAULT_TIMEOUT) #define ACE_DEFAULT_TIMEOUT 5 #endif /* ACE_DEFAULT_TIMEOUT */ #if !defined (ACE_DEFAULT_THREADS) #define ACE_DEFAULT_THREADS 1 #endif /* ACE_DEFAULT_THREADS */ // The following 3 defines are used in the IP multicast and broadcast tests. #if !defined (ACE_DEFAULT_BROADCAST_PORT) #define ACE_DEFAULT_BROADCAST_PORT 10000 #endif /* ACE_DEFAULT_BROADCAST_PORT */ #if !defined (ACE_DEFAULT_MULTICAST_PORT) #define ACE_DEFAULT_MULTICAST_PORT 10001 #endif /* ACE_DEFAULT_MULTICAST_PORT */ #if !defined (ACE_DEFAULT_MULTICAST_ADDR) #define ACE_DEFAULT_MULTICAST_ADDR "224.9.9.2" #endif /* ACE_DEFAULT_MULTICAST_ADDR */ // Default port number for HTTP. #if !defined (ACE_DEFAULT_HTTP_SERVER_PORT) #define ACE_DEFAULT_HTTP_SERVER_PORT 80 #endif /* ACE_DEFAULT_HTTP_SERVER_PORT */ // Used in many IPC_SAP tests #if !defined (ACE_DEFAULT_SERVER_PORT) #define ACE_DEFAULT_SERVER_PORT 10002 #endif /* ACE_DEFAULT_SERVER_PORT */ #if !defined (ACE_DEFAULT_MAX_SOCKET_BUFSIZ) #define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 65536 #endif /* ACE_DEFAULT_MAX_SOCKET_BUFSIZ */ #if !defined (ACE_DEFAULT_SERVER_PORT_STR) #define ACE_DEFAULT_SERVER_PORT_STR "10002" #endif /* ACE_DEFAULT_SERVER_PORT_STR */ // Used for the Service_Directory test #if !defined (ACE_DEFAULT_SERVICE_PORT) #define ACE_DEFAULT_SERVICE_PORT 10003 #endif /* ACE_DEFAULT_SERVICE_PORT */ // Used for the ACE_Thread_Spawn test #if !defined (ACE_DEFAULT_THR_PORT ) #define ACE_DEFAULT_THR_PORT 10004 #endif /* ACE_DEFAULT_THR_PORT */ // Used for SOCK_Connect::connect() tests #if !defined (ACE_DEFAULT_LOCAL_PORT) #define ACE_DEFAULT_LOCAL_PORT 10005 #endif /* ACE_DEFAULT_LOCAL_PORT */ // Used for Connector tests #if !defined (ACE_DEFAULT_LOCAL_PORT_STR) #define ACE_DEFAULT_LOCAL_PORT_STR "10005" #endif /* ACE_DEFAULT_LOCAL_PORT_STR */ // Used for the name server. #if !defined (ACE_DEFAULT_NAME_SERVER_PORT) #define ACE_DEFAULT_NAME_SERVER_PORT 10006 #endif /* ACE_DEFAULT_NAME_SERVER_PORT */ #if !defined (ACE_DEFAULT_NAME_SERVER_PORT_STR) #define ACE_DEFAULT_NAME_SERVER_PORT_STR "10006" #endif /* ACE_DEFAULT_NAME_SERVER_PORT_STR */ // Used for the token server. #if !defined (ACE_DEFAULT_TOKEN_SERVER_PORT) #define ACE_DEFAULT_TOKEN_SERVER_PORT 10007 #endif /* ACE_DEFAULT_TOKEN_SERVER_PORT */ #if !defined (ACE_DEFAULT_TOKEN_SERVER_PORT_STR) #define ACE_DEFAULT_TOKEN_SERVER_PORT_STR "10007" #endif /* ACE_DEFAULT_TOKEN_SERVER_PORT_STR */ // Used for the logging server. #if !defined (ACE_DEFAULT_LOGGING_SERVER_PORT) #define ACE_DEFAULT_LOGGING_SERVER_PORT 10008 #endif /* ACE_DEFAULT_LOGGING_SERVER_PORT */ #if !defined (ACE_DEFAULT_LOGGING_SERVER_PORT_STR) #define ACE_DEFAULT_LOGGING_SERVER_PORT_STR "10008" #endif /* ACE_DEFAULT_LOGGING_SERVER_PORT_STR */ // Used for the logging server. #if !defined (ACE_DEFAULT_THR_LOGGING_SERVER_PORT) #define ACE_DEFAULT_THR_LOGGING_SERVER_PORT 10008 #endif /* ACE_DEFAULT_THR_LOGGING_SERVER_PORT */ #if !defined (ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR) #define ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR "10008" #endif /* ACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR */ // Used for the gateway server. #if !defined (ACE_DEFAULT_GATEWAY_SERVER_PORT) #define ACE_DEFAULT_GATEWAY_SERVER_PORT 10009 #endif /* ACE_DEFAULT_GATEWAY_SERVER_PORT */ #if !defined (ACE_DEFAULT_GATEWAY_SERVER_PORT_STR) #define ACE_DEFAULT_GATEWAY_SERVER_PORT_STR "10009" #endif /* ACE_DEFAULT_GATEWAY_SERVER_PORT_STR */ // Used for the peer server. #if !defined (ACE_DEFAULT_PEER_SERVER_PORT) #define ACE_DEFAULT_PEER_SERVER_PORT 10010 #endif /* ACE_DEFAULT_PEER_SERVER_PORT */ #if !defined (ACE_DEFAULT_PEER_SERVER_PORT_STR) #define ACE_DEFAULT_PEER_SERVER_PORT_STR "10010" #endif /* ACE_DEFAULT_PEER_SERVER_PORT_STR */ // Used for the time server. #if !defined (ACE_DEFAULT_TIME_SERVER_PORT) #define ACE_DEFAULT_TIME_SERVER_PORT 10011 #endif /* ACE_DEFAULT_TIME_SERVER_PORT */ #if !defined (ACE_DEFAULT_TIME_SERVER_PORT_STR) #define ACE_DEFAULT_TIME_SERVER_PORT_STR "10011" #endif /* ACE_DEFAULT_TIME_SERVER_PORT_STR */ #if !defined (ACE_DEFAULT_TIME_SERVER_STR) #define ACE_DEFAULT_TIME_SERVER_STR "ACE_TS_TIME" #endif /* ACE_DEFAULT_TIME_SERVER_STR */ // Used by the FIFO tests and the Client_Logging_Handler netsvc. #if !defined (ACE_DEFAULT_RENDEZVOUS) #if defined (ACE_HAS_STREAM_PIPES) #define ACE_DEFAULT_RENDEZVOUS "/tmp/fifo.ace" #else #define ACE_DEFAULT_RENDEZVOUS "localhost:10012" #endif /* ACE_LACKS_FIFO */ #endif /* ACE_DEFAULT_RENDEZVOUS */ // The default starting port number for TAO servers. #if !defined (TAO_DEFAULT_SERVER_PORT) #define TAO_DEFAULT_SERVER_PORT 10013 #endif /* TAO_DEFAULT_SERVER_PORT */ #if !defined (ACE_DEFAULT_SERVER_HOST) #define ACE_DEFAULT_SERVER_HOST "localhost" #endif /* ACE_DEFAULT_SERVER_HOST */ // Default shared memory key #if !defined (ACE_DEFAULT_SHM_KEY) #define ACE_DEFAULT_SHM_KEY 1234 #endif /* ACE_DEFAULT_SHM_KEY */ // Default segment size used by SYSV shared memory (128 K) #if !defined (ACE_DEFAULT_SEGMENT_SIZE) #define ACE_DEFAULT_SEGMENT_SIZE 1024 * 128 #endif /* ACE_DEFAULT_SEGMENT_SIZE */ // Maximum number of SYSV shared memory segments // (does anyone know how to figure out the right values?!) #if !defined (ACE_DEFAULT_MAX_SEGMENTS) #define ACE_DEFAULT_MAX_SEGMENTS 6 #endif /* ACE_DEFAULT_MAX_SEGMENTS */ // Name of the map that's stored in shared memory. #if !defined (ACE_NAME_SERVER_MAP) #define ACE_NAME_SERVER_MAP "Name Server Map" #endif /* ACE_NAME_SERVER_MAP */ // Default file permissions. #if !defined (ACE_DEFAULT_FILE_PERMS) #define ACE_DEFAULT_FILE_PERMS 0666 #endif /* ACE_DEFAULT_FILE_PERMS */ // Default directory permissions. #if !defined (ACE_DEFAULT_DIR_PERMS) #define ACE_DEFAULT_DIR_PERMS 0777 #endif /* ACE_DEFAULT_DIR_PERMS */ // Default size of the ACE Reactor. #if !defined (ACE_DEFAULT_SELECT_REACTOR_SIZE) #define ACE_DEFAULT_SELECT_REACTOR_SIZE FD_SETSIZE #endif /* ACE_DEFAULT_SELECT_REACTOR_SIZE */ // Default size of the ACE Map_Manager. #if !defined (ACE_DEFAULT_MAP_SIZE) #define ACE_DEFAULT_MAP_SIZE 1024 #endif /* ACE_DEFAULT_MAP_SIZE */ // Defaults for ACE Timer Wheel #if !defined (ACE_DEFAULT_TIMER_WHEEL_SIZE) #define ACE_DEFAULT_TIMER_WHEEL_SIZE 1024 #endif /* ACE_DEFAULT_TIMER_WHEEL_SIZE */ #if !defined (ACE_DEFAULT_TIMER_WHEEL_RESOLUTION) #define ACE_DEFAULT_TIMER_WHEEL_RESOLUTION 100 #endif /* ACE_DEFAULT_TIMER_WHEEL_RESOLUTION */ // Default size for ACE Timer Hash table #if !defined (ACE_DEFAULT_TIMER_HASH_TABLE_SIZE) #define ACE_DEFAULT_TIMER_HASH_TABLE_SIZE 1024 #endif /* ACE_DEFAULT_TIMER_HASH_TABLE_SIZE */ // Defaults for the ACE Free List #if !defined (ACE_DEFAULT_FREE_LIST_PREALLOC) #define ACE_DEFAULT_FREE_LIST_PREALLOC 0 #endif /* ACE_DEFAULT_FREE_LIST_PREALLOC */ #if !defined (ACE_DEFAULT_FREE_LIST_LWM) #define ACE_DEFAULT_FREE_LIST_LWM 0 #endif /* ACE_DEFAULT_FREE_LIST_LWM */ #if !defined (ACE_DEFAULT_FREE_LIST_HWM) #define ACE_DEFAULT_FREE_LIST_HWM 25000 #endif /* ACE_DEFAULT_FREE_LIST_HWM */ #if !defined (ACE_DEFAULT_FREE_LIST_INC) #define ACE_DEFAULT_FREE_LIST_INC 100 #endif /* ACE_DEFAULT_FREE_LIST_INC */ #if !defined (ACE_UNIQUE_NAME_LEN) #define ACE_UNIQUE_NAME_LEN 100 #endif /* ACE_UNIQUE_NAME_LEN */ // Here are all ACE-specific global declarations needed throughout // ACE. // Helpful dump macros. #define ACE_BEGIN_DUMP "\n====\n(%P|%t|%x)" #define ACE_END_DUMP "====\n" // A free list which create more elements when there aren't enough // elements. #define ACE_FREE_LIST_WITH_POOL 1 // A simple free list which doen't allocate/deallocate elements. #define ACE_PURE_FREE_LIST 2 // This is used to indicate that a platform doesn't support a // particular feature. #if defined ACE_HAS_VERBOSE_NOTSUP // Print a console message with the file and line number of the // unsupported function. # define ACE_NOTSUP_RETURN(FAILVALUE) do { errno = ENOTSUP; ACE_OS::fprintf (stderr, "ACE_NOTSUP: %s, line %d\n", __FILE__, __LINE__); return FAILVALUE; } while (0) #else /* ! ACE_HAS_VERBOSE_NOTSUP */ # define ACE_NOTSUP_RETURN(FAILVALUE) do { errno = ENOTSUP ; return FAILVALUE; } while (0) #endif /* ! ACE_HAS_VERBOSE_NOTSUP */ #if defined (ACE_NDEBUG) #define ACE_DB(X) #else #define ACE_DB(X) X #endif /* ACE_NDEBUG */ // ACE_NO_HEAP_CHECK macro can be used to suppress false report of // memory leaks. It turns off the built-in heap checking until the // block is left. The old state will then be restored Only used for // Win32 (in the moment). #if defined (ACE_WIN32) // This is necessary to work around bugs with Win32 non-blocking // connects... #if !defined (ACE_NON_BLOCKING_BUG_DELAY) #define ACE_NON_BLOCKING_BUG_DELAY 35000 #endif /* ACE_NON_BLOCKING_BUG_DELAY */ #if defined (_DEBUG) class ACE_No_Heap_Check { public: ACE_No_Heap_Check (void) : old_state (_CrtSetDbgFlag (_CRTDBG_REPORT_FLAG)) { _CrtSetDbgFlag (old_state & ~_CRTDBG_ALLOC_MEM_DF);} ~ACE_No_Heap_Check (void) { _CrtSetDbgFlag (old_state);} private: int old_state; }; #define ACE_NO_HEAP_CHECK ACE_No_Heap_Check ____no_heap; #else /* !_DEBUG*/ #define ACE_NO_HEAP_CHECK #endif /* _DEBUG*/ #else /* !ACE_WIN32 */ #define ACE_NO_HEAP_CHECK #endif /* ACE_WIN32 */ // Increase the range of "address families". #define AF_SPIPE (AF_MAX + 1) #define AF_FILE (AF_MAX + 2) #define AF_DEV (AF_MAX + 3) #define AF_UPIPE (AF_SPIPE) // Turn a number into a string. #define ACE_ITOA(X) #X // Create a string of a server address with a "host:port" format. #define ACE_SERVER_ADDRESS(H,P) H":"P // A couple useful inline functions for checking whether bits are // enabled or disabled. // Efficiently returns the least power of two >= X... #define ACE_POW(X) (((X) == 0)?1:(X-=1,X|=X>>1,X|=X>>2,X|=X>>4,X|=X>>8,X|=X>>16,(++X))) #define ACE_EVEN(NUM) (((NUM) & 1) == 0) #define ACE_ODD(NUM) (((NUM) & 1) == 1) #define ACE_BIT_ENABLED(WORD, BIT) (((WORD) & (BIT)) != 0) #define ACE_BIT_DISABLED(WORD, BIT) (((WORD) & (BIT)) == 0) #define ACE_BIT_CMP_MASK(WORD, BIT, MASK) (((WORD) & (BIT)) == MASK) #define ACE_SET_BITS(WORD, BITS) (WORD |= (BITS)) #define ACE_CLR_BITS(WORD, BITS) (WORD &= ~(BITS)) #define ACE_MAX(x,y) (((x)>(y))?(x):(y)) #define ACE_MIN(x,y) (((x)<(y))?(x):(y)) // Keep the compiler from complaining about parameters which are not used. #if defined (ghs) || defined (__GNUC__) || defined (__hpux) || defined (__sgi) || defined (DEC_CXX) || defined (__KCC) // Some compilers complain about "statement with no effect" with (a). // This eliminates the warnings, and no code is generated for the null // conditional statement. NOTE: that may only be true if -O is enabled, // such as with GreenHills (ghs) 1.8.8. #define ACE_UNUSED_ARG(a) {if (&a) /* null */ ;} #else #define ACE_UNUSED_ARG(a) (a) #endif /* ghs */ #if defined (__sgi) || defined (ghs) || defined (DEC_CXX) #define ACE_NOTREACHED(a) #else #define ACE_NOTREACHED(a) a #endif #if defined (ACE_REQUIRES_FUNC_DEFINITIONS) // Provide a null definition for the function. Not pleasant. # define ACE_UNIMPLEMENTED_FUNC(f) f {} #else # define ACE_UNIMPLEMENTED_FUNC(f) f; #endif /* ACE_REQUIRES_FUNC_DEFINITIONS */ // Easy way to designate that a class is used as a pseudo-namespace. // Insures that g++ "friendship" anamolies are properly handled. #define ACE_CLASS_IS_NAMESPACE(CLASSNAME) \ private: \ ACE_UNIMPLEMENTED_FUNC (CLASSNAME (void)) \ ACE_UNIMPLEMENTED_FUNC (CLASSNAME (const CLASSNAME&)) \ class ace_dewarn_gplusplus; \ friend class ace_dewarn_gplusplus // These hooks enable ACE to have all dynamic memory management // automatically handled on a per-object basis. #if defined (ACE_HAS_ALLOC_HOOKS) #define ACE_ALLOC_HOOK_DECLARE \ void *operator new (size_t bytes); \ void operator delete (void *ptr); // Note that these are just place holders for now. They'll // be replaced by the ACE_Malloc stuff shortly... #define ACE_ALLOC_HOOK_DEFINE(CLASS) \ void *CLASS::operator new (size_t bytes) { return ::new char[bytes]; } \ void CLASS::operator delete (void *ptr) { delete (ptr); } #else #define ACE_ALLOC_HOOK_DECLARE struct __Ace {} /* Just need a dummy... */ #define ACE_ALLOC_HOOK_DEFINE(CLASS) #endif /* ACE_HAS_ALLOC_HOOKS */ #if defined (ACE_LACKS_KEY_T) #if defined (ACE_WIN32) // Win32 doesn't use numeric values to name its semaphores, it uses // strings! typedef char *key_t; #else typedef int key_t; #endif /* ACE_WIN32 */ #endif /* ACE_LACKS_KEY_T */ #if defined (VXWORKS) #if defined (ghs) // GreenHills 1.8.8 needs the stdarg.h #include before the #include of // vxWorks.h. // Also, be sure that these #includes come _after_ the key_t typedef, and // before the #include of time.h. #include /**/ #endif /* ghs */ #include /**/ #endif /* VXWORKS */ /////////////////////////////////////////// // // // NOTE: Please do not add any #includes // // before this point. On VxWorks, // // vxWorks.h must be #included // // first! // // // /////////////////////////////////////////// #if defined (ACE_HAS_CHARPTR_SPRINTF) #define ACE_SPRINTF_ADAPTER(X) ::strlen (X) #else #define ACE_SPRINTF_ADAPTER(X) X #endif /* ACE_HAS_CHARPTR_SPRINTF */ #if defined (__ACE_INLINE__) #define ACE_INLINE inline #if !defined (ACE_HAS_INLINED_OSCALLS) #define ACE_HAS_INLINED_OSCALLS #endif /* !ACE_HAS_INLINED_OSCALLS */ #else #define ACE_INLINE #endif /* __ACE_INLINE__ */ // Default address for shared memory mapped files and SYSV shared memory // (defaults to 64 M). #if !defined (ACE_DEFAULT_BASE_ADDR) #define ACE_DEFAULT_BASE_ADDR ((char *) (64 * 1024 * 1024)) #endif /* ACE_DEFAULT_BASE_ADDR */ // This fudge factor can be overriden for timers that need it, such as on // Solaris, by defining the ACE_TIMER_SKEW symbol in the appropriate config // header. #if !defined (ACE_TIMER_SKEW) #define ACE_TIMER_SKEW 0 #endif /* ACE_TIMER_SKEW */ // Nasty macro stuff to account for Microsoft Win32 DLL nonsense. We // use these macros so that we don't end up with ACE software // hard-coded to Microsoft proprietary extensions to C++. #if defined (ACE_HAS_DLL) && (ACE_HAS_DLL == 1) # if defined (ACE_BUILD_DLL) # if !defined (_MSC_VER) /* Mark classes as exported, Borland. */ # define ACE_Export _export // @@ Don't know how to handle this when using Borland's compilers. # define ACE_SINGLETON_DECLARATION (T) # define ACE_SINGLETON_INSTANTIATION (T) # else /* Microsoft: */ # define ACE_Export __declspec (dllexport) # define ACE_SINGLETON_DECLATATION (T) template class ACE_Export T # define ACE_SINGLETON_INSTANTIATION (T) template class T # endif /* !_MSC_VER */ # else /* Using the DLL. */ # define ACE_SINGLETON_INSTANTIATION (T) # if !defined _MSC_VER # define ACE_Export _import // @@ Don't know how to handle this when using Borland's compilers. # define ACE_SINGLETON_DECLARATION (T) # else # define ACE_Export __declspec (dllimport) # define ACE_SINGLETON_DECLARATION (T) extern template class T # endif /* !_MSC_VER */ # endif /* ACE_BUILD_DLL */ #else /* We're not building a DLL! */ # define ACE_Export # define ACE_SINGLETON_DECLARATION (T) # define ACE_SINGLETON_INSTANTIATION (T) #endif /* ACE_HAS_DLL */ #if defined (ACE_HAS_SVC_DLL) && (ACE_HAS_SVC_DLL == 1) # if defined (ACE_BUILD_SVC_DLL) # if !defined (_MSC_VER) /* Mark classes as exported, Borland. */ # define ACE_Svc_Export _export // @@ Don't know how to handle this when using Borland's compilers. # define ACE_SVC_SINGLETON_DECLARATION (T) # define ACE_SVC_SINGLETON_INSTANTIATION (T) # else /* Microsoft: */ # define ACE_Svc_Export __declspec (dllexport) # define ACE_SVC_SINGLETON_DECLARATION (T) template class ACE_Svc_Export T # define ACE_SVC_SINGLETON_INSTANTIATION (T) template class T # endif /* !_MSC_VER */ # else /* Using the DLL. */ # define ACE_SVC_SINGLETON_INSTANTIATION (T) # if !defined _MSC_VER # define ACE_Svc_Export _import // @@ Don't know how to handle this when using Borland's compilers. # define ACE_SVC_SINGLETON_DECLARATION (T) # else # define ACE_Svc_Export __declspec (dllimport) # define ACE_SVC_SINGLETON_DECLARATION (T) extern template class T # endif /* !_MSC_VER */ # endif /* ACE_BUILD_DLL || ACE_BUILD_SVC_DLL */ #else /* We're not building a DLL! */ # define ACE_Svc_Export # define ACE_SVC_SINGLETON_DECLARATION (T) # define ACE_SVC_SINGLETON_INSTANTIATION (T) #endif /* ACE_HAS_SVC_DLL */ // This needs to go here *first* to avoid problems with AIX. // Just to be safe we'll do it with pthreads, too -- jwr #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) extern "C" { #include /**/ #if defined (DIGITAL_UNIX) #define pthread_self __pthread_self extern "C" pthread_t pthread_self (void); #endif /* DIGITAL_UNIX */ } #endif /* ACE_HAS_DCETHREADS */ #if (ACE_NTRACE == 1) #define ACE_TRACE(X) #else #define ACE_TRACE(X) ACE_Trace ____ (X, __LINE__, __FILE__) #endif /* ACE_NTRACE */ #include /**/ #if defined (ACE_NEEDS_SYSTIME_H) // Some platforms may need to include this, but I suspect that most // will get it from #if defined (VXWORKS) #include /**/ #else #include /**/ #endif /* VXWORKS */ #endif /* ACE_NEEDS_SYSTIME_H */ #if !defined (ACE_HAS_POSIX_TIME) // Definition per POSIX. typedef struct timespec { time_t tv_sec; // Seconds long tv_nsec; // Nanoseconds } timespec_t; #elif defined (ACE_HAS_BROKEN_POSIX_TIME) // OSF/1 defines struct timespec in - Tom Marrs #include /**/ #endif /* !ACE_HAS_POSIX_TIME */ #if defined(ACE_LACKS_TIMESPEC_T) typedef struct timespec timespec_t; #endif /* ACE_LACKS_TIMESPEC_T */ #if !defined (ACE_HAS_CLOCK_GETTIME) && !defined (_CLOCKID_T) typedef int clockid_t; #if !defined (CLOCK_REALTIME) #define CLOCK_REALTIME 0 #endif /* CLOCK_REALTIME */ #endif /* ! ACE_HAS_CLOCK_GETTIME && ! _CLOCKID_T */ class ACE_Export ACE_Time_Value // = TITLE // Operations on "timeval" structures. // // = DESCRIPTION // This class centralizes all the time-related processing in // ACE. These timers are typically used in conjunction with // lower-level OS mechanisms like