Function nix_err_msg

Source
pub unsafe extern "C" fn nix_err_msg(
    context: *mut nix_c_context,
    ctx: *const nix_c_context,
    n: *mut c_uint,
) -> *const c_char
Expand description

@addtogroup errors Retrieves the most recent error message from a context. @pre This function should only be called after a previous nix function has returned an error.

§Arguments

  • context [out] - optional, the context to store errors in if this function fails
  • ctx [in] - the context to retrieve the error message from
  • n [out] - optional: a pointer to an unsigned int that is set to the length of the error.

§Returns

nullptr if no error message was ever set, a borrowed pointer to the error message otherwise, which is valid until the next call to a Nix function, or until the context is destroyed.