0001 libtraceevent(3)
0002 ================
0003
0004 NAME
0005 ----
0006 tep_strerror - Returns a string describing regular errno and tep error number.
0007
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013
0014 int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_);
0015
0016 --
0017 DESCRIPTION
0018 -----------
0019 The _tep_strerror()_ function converts tep error number into a human
0020 readable string.
0021 The _tep_ argument is trace event parser context. The _errnum_ is a regular
0022 errno, defined in errno.h, or a tep error number. The string, describing this
0023 error number is copied in the _buf_ argument. The _buflen_ argument is
0024 the size of the _buf_.
0025
0026 It as a thread safe wrapper around strerror_r(). The library function has two
0027 different behaviors - POSIX and GNU specific. The _tep_strerror()_ API always
0028 behaves as the POSIX version - the error string is copied in the user supplied
0029 buffer.
0030
0031 RETURN VALUE
0032 ------------
0033 The _tep_strerror()_ function returns 0, if a valid _errnum_ is passed and the
0034 string is copied into _buf_. If _errnum_ is not a valid error number,
0035 -1 is returned and _buf_ is not modified.
0036
0037 EXAMPLE
0038 -------
0039 [source,c]
0040 --
0041 #include <event-parse.h>
0042 ...
0043 struct tep_handle *tep = tep_alloc();
0044 ...
0045 char buf[32];
0046 char *pool = calloc(1, 128);
0047 if (tep == NULL) {
0048 tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32);
0049 printf ("The pool is not initialized, %s", buf);
0050 }
0051 ...
0052 --
0053
0054 FILES
0055 -----
0056 [verse]
0057 --
0058 *event-parse.h*
0059 Header file to include in order to have access to the library APIs.
0060 *-ltraceevent*
0061 Linker switch to add when building a program that uses the library.
0062 --
0063
0064 SEE ALSO
0065 --------
0066 _libtraceevent(3)_, _trace-cmd(1)_
0067
0068 AUTHOR
0069 ------
0070 [verse]
0071 --
0072 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0073 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0074 --
0075 REPORTING BUGS
0076 --------------
0077 Report bugs to <linux-trace-devel@vger.kernel.org>
0078
0079 LICENSE
0080 -------
0081 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0082
0083 RESOURCES
0084 ---------
0085 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git