diff options
Diffstat (limited to 'ACE/examples')
6 files changed, 31 insertions, 0 deletions
diff --git a/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp b/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp index 842c7fa2bca..673a32eccac 100644 --- a/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp +++ b/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp @@ -29,6 +29,7 @@ public: { cancel_state new_state; +#ifndef ACE_LACKS_PTHREAD_CANCEL // Set the cancel state to asynchronous and enabled. new_state.cancelstate = PTHREAD_CANCEL_ENABLE; new_state.canceltype = PTHREAD_CANCEL_ASYNCHRONOUS; @@ -37,6 +38,13 @@ public: ACE_TEXT ("%p\n"), ACE_TEXT ("cancelstate")), -1); return 0; + +#else + + ACE_ERROR ((LM_ERROR, "Pthread_cancel is not supported on this platform.\n")); + return -1; + +#endif } }; // Listing 1 diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp index c4b3944b26f..fe572822c3c 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp @@ -92,7 +92,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -1); char name[ACE_MAX_USERID]; + +#ifndef ACE_LACKS_CUSERID ACE_OS::cuserid (name); +#else + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: ::cuserid is not supported on this platform\n")), + -1); +#endif if (sd.send (name, ACE_OS::strlen (name) + 1, diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl index 03b87ef905c..b82dadd9278 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl @@ -15,8 +15,12 @@ Handle_L_Stream::~Handle_L_Stream (void) ACE_INLINE Handle_L_Stream::Handle_L_Stream (void) { +#ifndef ACE_LACKS_CUSERID if (Handle_L_Stream::login_name == 0) Handle_L_Stream::login_name = ACE_OS::cuserid (Handle_L_Stream::login); +#else + ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform")); +#endif } ACE_INLINE int diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl index 2a9d9f84fdd..5509dbdcb0a 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl @@ -12,8 +12,12 @@ ACE_INLINE Handle_R_Stream::Handle_R_Stream (void) { +#ifndef ACE_LACKS_CUSERID if (Handle_R_Stream::login_name == 0) Handle_R_Stream::login_name = ACE_OS::cuserid (Handle_R_Stream::login); +#else + ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform")); +#endif } ACE_INLINE int diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp index f5b952ca7a1..d51ac01f923 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp @@ -158,7 +158,11 @@ CLI_Stream<PR_ST_2>::svc (void) ACE_OS::fflush (stdout); time_t t = ACE_OS::time (0L); +#ifndef ACE_LACKS_CUSERID ACE_OS::cuserid (login_name); +#else + ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform")); +#endif ACE_OS::sprintf (buf, "user %s %s", login_name, diff --git a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp index d2bcf36cc9e..5fb5b98c492 100644 --- a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp +++ b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp @@ -19,9 +19,14 @@ ACE_TMAIN (int, ACE_TCHAR *[]) ACE_Typed_SV_Message_Queue<Message_Data> msgque (key_t (SRV_KEY)); +#ifndef ACE_LACKS_CUSERID Message_Data msg_data (pid, ACE_OS::cuserid (static_cast<char *> (0)), "did you get this?"); +#else + Message_Data msg_data; + ACE_ERROR ((LM_ERROR, "Error: platform lacks cuserid\n")); +#endif ACE_Typed_SV_Message<Message_Data> send_msg (msg_data, SRV_ID, |