dtrace_errmsg
() and dtrace_errno
() Functions
Embedding DTrace in a Consumer uses two functions, dtrace_errno
() and dtrace_errmsg
(), for error reporting. The dtrace_errno
() function returns the error number set by the last call to the DTrace API by using a particular DTrace handle. The dtrace_errmsg
() function takes a DTrace handle and an error number, and returns a corresponding error message. The messages for most errors are stored in a table in the libdtrace
library. For compiler errors, the error string is written to an error message buffer of the DTrace handle. Errors that deal with compact C type format (CTF) are handled separately based on a CTF-specific error number stored in the DTrace handle. For more information, see the libdtrace
(3LIB) man page.
const char *dtrace_errmsg(dtrace_hdl_t *dtp, int error) int dtrace_errno(dtrace_hdl_t *dtp)