SET_CONSTRAINT_HANDLER_S(3C) Standard C Library Functions NNAAMMEE sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss, aabboorrtt__hhaannddlleerr__ss, iiggnnoorree__hhaannddlleerr__ss - runtime- constraint handling LLIIBBRRAARRYY Standard C Library (libc, -lc) SSYYNNOOPPSSIISS ##ddeeffiinnee ____SSTTDDCC__WWAANNTT__LLIIBB__EEXXTT11____ 11 ##iinncclluuddee <> _c_o_n_s_t_r_a_i_n_t___h_a_n_d_l_e_r___t sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss(_c_o_n_s_t_r_a_i_n_t___h_a_n_d_l_e_r___t _h_a_n_d_l_e_r); _v_o_i_d aabboorrtt__hhaannddlleerr__ss(_c_o_n_s_t _c_h_a_r _*_r_e_s_t_r_i_c_t _m_s_g, _v_o_i_d _*_r_e_s_t_r_i_c_t _p_t_r, _e_r_r_n_o___t _e_r_r_o_r); _v_o_i_d iiggnnoorree__hhaannddlleerr__ss(_c_o_n_s_t _c_h_a_r _*_r_e_s_t_r_i_c_t _m_s_g, _v_o_i_d _*_r_e_s_t_r_i_c_t _p_t_r, _e_r_r_n_o___t _e_r_r_o_r); DDEESSCCRRIIPPTTIIOONN The sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() function sets the runtime-constraint handler to be _h_a_n_d_l_e_r. The runtime-constraint handler is the callback function invoked when a library function detects a runtime-constraint violation, having the following prototype: void (*constraint_handler_t)(const char *restrict msg, void *restrict ptr, errno_t error); The arguments are as follows: _m_s_g A pointer to a character string describing the runtime-constraint violation. _p_t_r A NULL pointer. _e_r_r_o_r If the function calling the handler has a return type declared as _e_r_r_n_o___t, the return value of the function is passed. Otherwise, a positive value of type _e_r_r_n_o___t is passed. Only the most recent handler registered with sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() is called when a runtime-constraint violation occurs. The implementation has a default constraint handler that is used if no calls to the sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() function have been made. If the _h_a_n_d_l_e_r argument to sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() is a NULL pointer, the default handler becomes the current constraint handler. The aabboorrtt__hhaannddlleerr__ss() and iiggnnoorree__hhaannddlleerr__ss() are the standard-defined runtime-constraint handlers provided by the C library. The aabboorrtt__hhaannddlleerr__ss() function writes the error message including the _m_s_g to stderr and calls the abort(3C) function. The aabboorrtt__hhaannddlleerr__ss() is currently the default runtime-constraint handler. The iiggnnoorree__hhaannddlleerr__ss() simply returns to its caller. RREETTUURRNN VVAALLUUEESS The sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() function returns a pointer to the previously registered handler, or NULL if none was previously registered. The aabboorrtt__hhaannddlleerr__ss() function does not return to its caller. The iiggnnoorree__hhaannddlleerr__ss() function returns no value. IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY SSttaannddaarrdd MMTT--LLEEVVEELL SSaaffee SSTTAANNDDAARRDDSS The sseett__ccoonnssttrraaiinntt__hhaannddlleerr__ss() function conforms to ISO/IEC 9899:2011 ("ISO C11"). illumos August 12, 2017 illumos