Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit


» HP STK home
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
Content starts here

critical impact:

DCE exceptions - not available (CrUn79)

TH Impacts

Problem description

DCE-style C language exception support exists on Tru64 UNIX, but not on HP-UX.

On Tru64 UNIX, POSIX cancellation (pthread_cancel) and thread exit (pthread_exit) are implemented using cross-language exception support built into the operating system. Unhandled synchronous signals (including SIGSEGV) are by default converted into exceptions. POSIX cancel or thread exit can also be caught as exceptions, in addition to the POSIX standard mechanism using pthread_cleanup_push and pthread_cleanup_pop (implemented using exception handling on Tru64 UNIX).


C/C++ FunctionsCATCH C/C++ Functionspthread_exc_raise_np
C/C++ FunctionsCATCH_ALL C/C++ Functionspthread_exc_raise_status_np
C/C++ FunctionsENDTRY C/C++ Functionspthread_exc_report_np
C/C++ FunctionsFINALLY C/C++ Misc. Identifierspthread_exc_resaddr_e
C/C++ Misc. Identifierspthread_exc_aritherr_e C/C++ Misc. Identifierspthread_exc_resoper_e
C/C++ Misc. Identifierspthread_exc_cancel_e C/C++ Functionspthread_exc_set_status_np
C/C++ Misc. Identifierspthread_exc_decovf_e C/C++ Misc. Identifierspthread_exc_SIBIOT_e
C/C++ Misc. Identifierspthread_exc_excpu_e C/C++ Misc. Identifierspthread_exc_SIGABRT_e
C/C++ Misc. Identifierspthread_exc_exfilsiz_e C/C++ Misc. Identifierspthread_exc_SIGBUS_e
C/C++ Misc. Identifierspthread_exc_exit_e C/C++ Misc. Identifierspthread_exc_SIGEMT_e
C/C++ Misc. Identifierspthread_exc_exquota_e C/C++ Misc. Identifierspthread_exc_SIGFPE_e
C/C++ Misc. Identifierspthread_exc_fltdiv_e C/C++ Misc. Identifierspthread_exc_SIGILL_e
C/C++ Misc. Identifierspthread_exc_fltovf_e C/C++ Misc. Identifierspthread_exc_SIGPIPE_e
C/C++ Misc. Identifierspthread_exc_fltund_e C/C++ Misc. Identifierspthread_exc_SIGSEGV_e
C/C++ Functionspthread_exc_get_message_np C/C++ Misc. Identifierspthread_exc_SIGSYS_e
C/C++ Functionspthread_exc_get_status_np C/C++ Misc. Identifierspthread_exc_SIGTRAP_e
C/C++ Misc. Identifierspthread_exc_illaddr_e C/C++ Misc. Identifierspthread_exc_stackovf_e
C/C++ Misc. Identifierspthread_exc_illinstr_e C/C++ Misc. Identifierspthread_exc_subrng_e
C/C++ Misc. Identifierspthread_exc_insfmem_e C/C++ Misc. Identifierspthread_exc_uninitexc_e
C/C++ Misc. Identifierspthread_exc_intdiv_e C/C++ Header Filespthread_exception.h
C/C++ Misc. Identifierspthread_exc_intovf_e C/C++ FunctionsRAISE
C/C++ Functionspthread_exc_matches_np C/C++ FunctionsRERAISE
C/C++ Misc. Identifierspthread_exc_noexcmem_e C/C++ FunctionsTHIS_CATCH
C/C++ Misc. Identifierspthread_exc_nopriv_e C/C++ FunctionsTRY
C/C++ Misc. Identifierspthread_exc_privinst_e  

Old behavior

TRY call_foo(); CATCH_ALL {printf ("Failed\n");} ENDTRY

See also

Solution description

To perform cleanup operations on cancellation or thread exit, use the POSIX standard operations pthread_cleanup_push and pthread_cleanup_pop. To handle synchronous signals, use sigaction to register a signal-catching function.

HP-UX does not support exceptions within the C language. It is not possible for the C language code to prevent termination of a cancelled thread by catching the cancel; it can only clean up using a cleanup handler, and return to continue the termination. (This is equivalent to the behavior of the FINALLY macro, or a C++ object destructor.)

New behavior

pthread_cleanup_push (handler, NULL); call_foo(); pthread_cleanup_pop (0);

See also

Problem summary

classifications source types OS release severity type
TH C, C++ any HP-UX 11i version critical unavailable
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.