ERR_get_error(3) OpenSSL ERR_get_error(3) NNAAMMEE ERR_get_error, ERR_peek_error, ERR_peek_last_error, ERR_get_error_line, ERR_peek_error_line, ERR_peek_last_error_line, ERR_get_error_line_data, ERR_peek_error_line_data, ERR_peek_last_error_line_data - obtain error code and data SSYYNNOOPPSSIISS #include unsigned long ERR_get_error(void); unsigned long ERR_peek_error(void); unsigned long ERR_peek_last_error(void); unsigned long ERR_get_error_line(const char **file, int *line); unsigned long ERR_peek_error_line(const char **file, int *line); unsigned long ERR_peek_last_error_line(const char **file, int *line); unsigned long ERR_get_error_line_data(const char **file, int *line, const char **data, int *flags); unsigned long ERR_peek_error_line_data(const char **file, int *line, const char **data, int *flags); unsigned long ERR_peek_last_error_line_data(const char **file, int *line, const char **data, int *flags); DDEESSCCRRIIPPTTIIOONN _E_R_R___g_e_t___e_r_r_o_r_(_) returns the earliest error code from the thread's error queue and removes the entry. This function can be called repeatedly until there are no more error codes to return. _E_R_R___p_e_e_k___e_r_r_o_r_(_) returns the earliest error code from the thread's error queue without modifying it. _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r_(_) returns the latest error code from the thread's error queue without modifying it. See _E_R_R___G_E_T___L_I_B(3) for obtaining information about location and reason of the error, and _E_R_R___e_r_r_o_r___s_t_r_i_n_g(3) for human-readable error mes- sages. _E_R_R___g_e_t___e_r_r_o_r___l_i_n_e_(_), _E_R_R___p_e_e_k___e_r_r_o_r___l_i_n_e_(_) and _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r___l_i_n_e_(_) are the same as the above, but they addi- tionally store the file name and line number where the error occurred in *ffiillee and *lliinnee, unless these are NNUULLLL. _E_R_R___g_e_t___e_r_r_o_r___l_i_n_e___d_a_t_a_(_), _E_R_R___p_e_e_k___e_r_r_o_r___l_i_n_e___d_a_t_a_(_) and _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r___l_i_n_e___d_a_t_a_(_) store additional data and flags associ- ated with the error code in *ddaattaa and *ffllaaggss, unless these are NNUULLLL. *ddaattaa contains a string if *ffllaaggss&EERRRR__TTXXTT__SSTTRRIINNGG is true. An application MMUUSSTT NNOOTT free the *ddaattaa pointer (or any other pointers returned by these functions) with _O_P_E_N_S_S_L___f_r_e_e_(_) as freeing is handled automatically by the error library. RREETTUURRNN VVAALLUUEESS The error code, or 0 if there is no error in the queue. SSEEEE AALLSSOO _e_r_r(3), _E_R_R___e_r_r_o_r___s_t_r_i_n_g(3), _E_R_R___G_E_T___L_I_B(3) HHIISSTTOORRYY _E_R_R___g_e_t___e_r_r_o_r_(_), _E_R_R___p_e_e_k___e_r_r_o_r_(_), _E_R_R___g_e_t___e_r_r_o_r___l_i_n_e_(_) and _E_R_R___p_e_e_k___e_r_r_o_r___l_i_n_e_(_) are available in all versions of SSLeay and OpenSSL. _E_R_R___g_e_t___e_r_r_o_r___l_i_n_e___d_a_t_a_(_) and _E_R_R___p_e_e_k___e_r_r_o_r___l_i_n_e___d_a_t_a_(_) were added in SSLeay 0.9.0. _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r_(_), _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r___l_i_n_e_(_) and _E_R_R___p_e_e_k___l_a_s_t___e_r_r_o_r___l_i_n_e___d_a_t_a_(_) were added in OpenSSL 0.9.7. 1.0.1u 2016-09-22 ERR_get_error(3)