diff options
author | jb <jb@FreeBSD.org> | 2008-04-26 04:57:45 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 2008-04-26 04:57:45 +0000 |
commit | 195c17a37599300d03cb6f507e11e46ee11b75d3 (patch) | |
tree | ede5ba896ea3b48e62cbb223e54c27b0fd2ac6a9 /cddl | |
parent | 14d04ad60710218703c62cd922999edcb3ff5ac4 (diff) | |
download | FreeBSD-src-195c17a37599300d03cb6f507e11e46ee11b75d3.zip FreeBSD-src-195c17a37599300d03cb6f507e11e46ee11b75d3.tar.gz |
* Handle the different ioctl design.
* Make this file compile cleanly.
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c index 5353bfa..fa1407f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c @@ -35,7 +35,9 @@ #include <stdlib.h> #include <unistd.h> #include <limits.h> +#if defined(sun) #include <alloca.h> +#endif #include <errno.h> #include <fcntl.h> @@ -795,7 +797,12 @@ dt_options_load(dtrace_hdl_t *dtp) bzero(&hdr, sizeof (dof_hdr_t)); hdr.dofh_loadsz = sizeof (dof_hdr_t); +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &hdr) == -1) +#else + dof = &hdr; + if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &dof) == -1) +#endif return (dt_set_errno(dtp, errno)); if (hdr.dofh_loadsz < sizeof (dof_hdr_t)) @@ -808,7 +815,11 @@ dt_options_load(dtrace_hdl_t *dtp) for (i = 0; i < DTRACEOPT_MAX; i++) dtp->dt_options[i] = DTRACEOPT_UNSET; +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_DOFGET, dof) == -1) +#else + if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &dof) == -1) +#endif return (dt_set_errno(dtp, errno)); for (i = 0; i < dof->dofh_secnum; i++) { @@ -912,7 +923,7 @@ static const dt_option_t _dtrace_ctoptions[] = { { "verbose", dt_opt_cflags, DTRACE_C_DIFV }, { "version", dt_opt_version }, { "zdefs", dt_opt_cflags, DTRACE_C_ZDEFS }, - { NULL } + { NULL, NULL, 0 } }; /* @@ -936,7 +947,7 @@ static const dt_option_t _dtrace_rtoptions[] = { { "statusrate", dt_opt_rate, DTRACEOPT_STATUSRATE }, { "strsize", dt_opt_strsize, DTRACEOPT_STRSIZE }, { "ustackframes", dt_opt_runtime, DTRACEOPT_USTACKFRAMES }, - { NULL } + { NULL, NULL, 0 } }; /* @@ -953,7 +964,7 @@ static const dt_option_t _dtrace_drtoptions[] = { { "rawbytes", dt_opt_runtime, DTRACEOPT_RAWBYTES }, { "stackindent", dt_opt_runtime, DTRACEOPT_STACKINDENT }, { "switchrate", dt_opt_rate, DTRACEOPT_SWITCHRATE }, - { NULL } + { NULL, NULL, 0 } }; int |