ERR_error_string 3 2005-03-25 0.9.9-dev OpenSSL

NAME

ERR_error_string, ERR_error_string_n, ERR_lib_error_string, ERR_func_error_string, ERR_reason_error_string - obtain human-readable error message

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 


 char *ERR_error_string(unsigned long e, char *buf);
 void ERR_error_string_n(unsigned long e, char *buf, size_t len);


 const char *ERR_lib_error_string(unsigned long e);
 const char *ERR_func_error_string(unsigned long e);
 const char *ERR_reason_error_string(unsigned long e);

DESCRIPTION

_E_R_R___e_r_r_o_r___s_t_r_i_n_g_(_) generates a human-readable string representing the error code _e, and places it at _b_u_f. _b_u_f must be at least 120 bytes long. If _b_u_f is NNUULLLL, the error string is placed in a static buffer. _E_R_R___e_r_r_o_r___s_t_r_i_n_g___n_(_) is a variant of _E_R_R___e_r_r_o_r___s_t_r_i_n_g_(_) that writes at most _l_e_n characters (including the terminating 0) and truncates the string if necessary. For _E_R_R___e_r_r_o_r___s_t_r_i_n_g___n_(_), _b_u_f may not be NNUULLLL.

The string will have the following format:


 error:[error code]:[library name]:[function name]:[reason string]

_e_r_r_o_r _c_o_d_e is an 8 digit hexadecimal number, _l_i_b_r_a_r_y _n_a_m_e, _f_u_n_c_t_i_o_n _n_a_m_e and _r_e_a_s_o_n _s_t_r_i_n_g are ASCII text.

_E_R_R___l_i_b___e_r_r_o_r___s_t_r_i_n_g_(_), _E_R_R___f_u_n_c___e_r_r_o_r___s_t_r_i_n_g_(_) and _E_R_R___r_e_a_s_o_n___e_r_r_o_r___s_t_r_i_n_g_(_) return the library name, function name and reason string respectively.

The OpenSSL error strings should be loaded by calling _E_R_R___l_o_a_d___c_r_y_p_t_o___s_t_r_i_n_g_s(3) or, for SSL applications, _S_S_L___l_o_a_d___e_r_r_o_r___s_t_r_i_n_g_s(3) first. If there is no text string registered for the given error code, the error string will contain the numeric code.

_E_R_R___p_r_i_n_t___e_r_r_o_r_s(3) can be used to print all error codes currently in the queue.

RETURN VALUES

_E_R_R___e_r_r_o_r___s_t_r_i_n_g_(_) returns a pointer to a static buffer containing the string if _b_u_f ==== NNUULLLL, _b_u_f otherwise.

_E_R_R___l_i_b___e_r_r_o_r___s_t_r_i_n_g_(_), _E_R_R___f_u_n_c___e_r_r_o_r___s_t_r_i_n_g_(_) and _E_R_R___r_e_a_s_o_n___e_r_r_o_r___s_t_r_i_n_g_(_) return the strings, and NNUULLLL if none is registered for the error code.

SEE ALSO

_o_p_e_n_s_s_l___e_r_r(3), _E_R_R___g_e_t___e_r_r_o_r(3), _E_R_R___l_o_a_d___c_r_y_p_t_o___s_t_r_i_n_g_s(3), _S_S_L___l_o_a_d___e_r_r_o_r___s_t_r_i_n_g_s(3) _E_R_R___p_r_i_n_t___e_r_r_o_r_s(3)

HISTORY

_E_R_R___e_r_r_o_r___s_t_r_i_n_g_(_) is available in all versions of SSLeay and OpenSSL. _E_R_R___e_r_r_o_r___s_t_r_i_n_g___n_(_) was added in OpenSSL 0.9.6.