ERR_GET_LIB.pod 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. =pod
  2. =head1 NAME
  3. ERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON, ERR_FATAL_ERROR
  4. - get information from error codes
  5. =head1 SYNOPSIS
  6. #include <openssl/err.h>
  7. int ERR_GET_LIB(unsigned long e);
  8. int ERR_GET_FUNC(unsigned long e);
  9. int ERR_GET_REASON(unsigned long e);
  10. int ERR_FATAL_ERROR(unsigned long e);
  11. =head1 DESCRIPTION
  12. The error code returned by ERR_get_error() consists of a library
  13. number, function code and reason code. ERR_GET_LIB(), ERR_GET_FUNC()
  14. and ERR_GET_REASON() can be used to extract these.
  15. ERR_FATAL_ERROR() indicates whether a given error code is a fatal error.
  16. The library number and function code describe where the error
  17. occurred, the reason code is the information about what went wrong.
  18. Each sub-library of OpenSSL has a unique library number; function and
  19. reason codes are unique within each sub-library. Note that different
  20. libraries may use the same value to signal different functions and
  21. reasons.
  22. B<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally
  23. unique. However, when checking for sub-library specific reason codes,
  24. be sure to also compare the library number.
  25. ERR_GET_LIB(), ERR_GET_FUNC(), ERR_GET_REASON(), and ERR_FATAL_ERROR()
  26. are macros.
  27. =head1 RETURN VALUES
  28. The library number, function code, reason code, and whether the error
  29. is fatal, respectively.
  30. Starting with OpenSSL 3.0.0, the function code is always set to zero.
  31. =head1 SEE ALSO
  32. L<ERR_get_error(3)>
  33. =head1 HISTORY
  34. ERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are available in
  35. all versions of OpenSSL.
  36. =head1 COPYRIGHT
  37. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  38. Licensed under the Apache License 2.0 (the "License"). You may not use
  39. this file except in compliance with the License. You can obtain a copy
  40. in the file LICENSE in the source distribution or at
  41. L<https://www.openssl.org/source/license.html>.
  42. =cut