* Handle the different ioctl design.
* Make this file compile cleanly.
This commit is contained in:
parent
5ec5669275
commit
132df6e9ab
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user