ERR_GET_LIB.pod 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. =pod
  2. =head1 NAME
  3. ERR_GET_LIB, 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_REASON(unsigned long e);
  9. int ERR_FATAL_ERROR(unsigned long e);
  10. =head1 DESCRIPTION
  11. The error code returned by ERR_get_error() consists of a library
  12. number and reason code. ERR_GET_LIB()
  13. and ERR_GET_REASON() can be used to extract these.
  14. ERR_FATAL_ERROR() indicates whether a given error code is a fatal error.
  15. The library number describes where the error
  16. occurred, the reason code is the information about what went wrong.
  17. Each sub-library of OpenSSL has a unique library number; the
  18. reason code is unique within each sub-library. Note that different
  19. libraries may use the same value to signal different reasons.
  20. B<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally
  21. unique. However, when checking for sub-library specific reason codes,
  22. be sure to also compare the library number.
  23. ERR_GET_LIB(), ERR_GET_REASON(), and ERR_FATAL_ERROR() are macros.
  24. =head1 RETURN VALUES
  25. The library number, reason code, and whether the error
  26. is fatal, respectively.
  27. Starting with OpenSSL 3.0.0, the function code is always set to zero.
  28. =head1 NOTES
  29. Applications should not make control flow decisions based on specific error
  30. codes. Error codes are subject to change at any time (even in patch releases of
  31. OpenSSL). A particular error code can only be considered meaningful for control
  32. flow decisions if it is explicitly documented as such. New failure codes may
  33. still appear at any time.
  34. =head1 SEE ALSO
  35. L<ERR_get_error(3)>
  36. =head1 HISTORY
  37. ERR_GET_LIB() and ERR_GET_REASON() are available in all versions of OpenSSL.
  38. ERR_GET_FUNC() was removed in OpenSSL 3.0.
  39. =head1 COPYRIGHT
  40. Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the Apache License 2.0 (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut