1libtraceevent(3) 2================ 3 4NAME 5---- 6tep_strerror - Returns a string describing regular errno and tep error number. 7 8SYNOPSIS 9-------- 10[verse] 11-- 12*#include <event-parse.h>* 13 14int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_); 15 16-- 17DESCRIPTION 18----------- 19The _tep_strerror()_ function converts tep error number into a human 20readable string. 21The _tep_ argument is trace event parser context. The _errnum_ is a regular 22errno, defined in errno.h, or a tep error number. The string, describing this 23error number is copied in the _buf_ argument. The _buflen_ argument is 24the size of the _buf_. 25 26It as a thread safe wrapper around strerror_r(). The library function has two 27different behaviors - POSIX and GNU specific. The _tep_strerror()_ API always 28behaves as the POSIX version - the error string is copied in the user supplied 29buffer. 30 31RETURN VALUE 32------------ 33The _tep_strerror()_ function returns 0, if a valid _errnum_ is passed and the 34string is copied into _buf_. If _errnum_ is not a valid error number, 35-1 is returned and _buf_ is not modified. 36 37EXAMPLE 38------- 39[source,c] 40-- 41#include <event-parse.h> 42... 43struct tep_handle *tep = tep_alloc(); 44... 45char buf[32]; 46char *pool = calloc(1, 128); 47if (tep == NULL) { 48 tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32); 49 printf ("The pool is not initialized, %s", buf); 50} 51... 52-- 53 54FILES 55----- 56[verse] 57-- 58*event-parse.h* 59 Header file to include in order to have access to the library APIs. 60*-ltraceevent* 61 Linker switch to add when building a program that uses the library. 62-- 63 64SEE ALSO 65-------- 66_libtraceevent(3)_, _trace-cmd(1)_ 67 68AUTHOR 69------ 70[verse] 71-- 72*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*. 73*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page. 74-- 75REPORTING BUGS 76-------------- 77Report bugs to <linux-trace-devel@vger.kernel.org> 78 79LICENSE 80------- 81libtraceevent is Free Software licensed under the GNU LGPL 2.1 82 83RESOURCES 84--------- 85https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 86