1LIBTRACEEVENT(3) libtraceevent Manual LIBTRACEEVENT(3)
2
3
4
6 tep_strerror - Returns a string describing regular errno and tep error
7 number.
8
10 #include <event-parse.h>
11
12 int tep_strerror(struct tep_handle *tep, enum tep_errno errnum, char *buf, size_t buflen);
13
15 The tep_strerror() function converts tep error number into a human
16 readable string. The tep argument is trace event parser context. The
17 errnum is a regular errno, defined in errno.h, or a tep error number.
18 The string, describing this error number is copied in the buf argument.
19 The buflen argument is the size of the buf.
20
21 It as a thread safe wrapper around strerror_r(). The library function
22 has two different behaviors - POSIX and GNU specific. The
23 tep_strerror() API always behaves as the POSIX version - the error
24 string is copied in the user supplied buffer.
25
27 The tep_strerror() function returns 0, if a valid errnum is passed and
28 the string is copied into buf. If errnum is not a valid error number,
29 -1 is returned and buf is not modified.
30
32 #include <event-parse.h>
33 ...
34 struct tep_handle *tep = tep_alloc();
35 ...
36 char buf[32];
37 char *pool = calloc(1, 128);
38 if (tep == NULL) {
39 tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32);
40 printf ("The pool is not initialized, %s", buf);
41 }
42 ...
43
45 event-parse.h
46 Header file to include in order to have access to the library APIs.
47 -ltraceevent
48 Linker switch to add when building a program that uses the library.
49
51 libtraceevent(3), trace-cmd(1)
52
54 Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
55 Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
56
58 Report bugs to <linux-trace-devel@vger.kernel.org[3]>
59
61 libtraceevent is Free Software licensed under the GNU LGPL 2.1
62
64 https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
65
67 1. rostedt@goodmis.org
68 mailto:rostedt@goodmis.org
69
70 2. tz.stoyanov@gmail.com
71 mailto:tz.stoyanov@gmail.com
72
73 3. linux-trace-devel@vger.kernel.org
74 mailto:linux-trace-devel@vger.kernel.org
75
76
77
78libtraceevent 1.1.1 02/08/2021 LIBTRACEEVENT(3)