1ERR_NEW(3ossl)                      OpenSSL                     ERR_NEW(3ossl)
2
3
4

NAME

6       ERR_new, ERR_set_debug, ERR_set_error, ERR_vset_error - Error recording
7       building blocks
8

SYNOPSIS

10        #include <openssl/err.h>
11
12        void ERR_new(void);
13        void ERR_set_debug(const char *file, int line, const char *func);
14        void ERR_set_error(int lib, int reason, const char *fmt, ...);
15        void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
16

DESCRIPTION

18       The functions described here are generally not used directly, but
19       rather through macros such as ERR_raise(3).  They can still be useful
20       for anyone that wants to make their own macros.
21
22       ERR_new() allocates a new slot in the thread's error queue.
23
24       ERR_set_debug() sets the debug information related to the current error
25       in the thread's error queue.  The values that can be given are the
26       filename file, line in the file line and the name of the function func
27       where the error occurred.  The names must be constant, this function
28       will only save away the pointers, not copy the strings.
29
30       ERR_set_error() sets the error information, which are the library
31       number lib and the reason code reason, and additional data as a format
32       string fmt and an arbitrary number of arguments.  The additional data
33       is processed with BIO_snprintf(3) to form the additional data string,
34       which is allocated and store in the error record.
35
36       ERR_vset_error() works like ERR_set_error(), but takes a va_list
37       argument instead of a variable number of arguments.
38

RETURN VALUES

40       ERR_new, ERR_set_debug, ERR_set_error and ERR_vset_error do not return
41       any values.
42

NOTES

44       The library number is unique to each unit that records errors.  OpenSSL
45       has a number of preallocated ones for its own uses, but others may
46       allocate their own library number dynamically with
47       ERR_get_next_error_library(3).
48
49       Reason codes are unique within each library, and may have an associated
50       set of strings as a short description of the reason.  For dynamically
51       allocated library numbers, reason strings are recorded with
52       ERR_load_strings(3).
53
54       Provider authors are supplied with core versions of these functions,
55       see provider-base(7).
56

SEE ALSO

58       ERR_raise(3), ERR_get_next_error_library(3), ERR_load_strings(3),
59       BIO_snprintf(3), provider-base(7)
60
62       Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
63
64       Licensed under the Apache License 2.0 (the "License").  You may not use
65       this file except in compliance with the License.  You can obtain a copy
66       in the file LICENSE in the source distribution or at
67       <https://www.openssl.org/source/license.html>.
68
69
70
713.1.1                             2023-08-31                    ERR_NEW(3ossl)
Impressum