diff options
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c index 5005f59..263f70c 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c @@ -25,6 +25,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include <string.h> #include <strings.h> #include <dt_impl.h> @@ -138,12 +139,29 @@ dtrace_errno(dtrace_hdl_t *dtp) return (dtp->dt_errno); } +#if defined(sun) int dt_set_errno(dtrace_hdl_t *dtp, int err) { dtp->dt_errno = err; return (-1); } +#else +int +_dt_set_errno(dtrace_hdl_t *dtp, int err, const char *errfile, int errline) +{ + dtp->dt_errno = err; + dtp->dt_errfile = errfile; + dtp->dt_errline = errline; + return (-1); +} + +void dt_get_errloc(dtrace_hdl_t *dtp, const char **p_errfile, int *p_errline) +{ + *p_errfile = dtp->dt_errfile; + *p_errline = dtp->dt_errline; +} +#endif void dt_set_errmsg(dtrace_hdl_t *dtp, const char *errtag, const char *region, |