Handle the different level of indirection between ioctl on SYSV vs BSD.

This commit is contained in:
John Birrell 2008-04-26 04:20:11 +00:00
parent 29f89dfce7
commit df5c121dfe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178553

View File

@ -32,7 +32,9 @@
#include <errno.h>
#include <assert.h>
#include <ctype.h>
#if defined(sun)
#include <alloca.h>
#endif
#include <dt_impl.h>
#include <dt_program.h>
@ -151,6 +153,7 @@ int
dtrace_program_exec(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
dtrace_proginfo_t *pip)
{
dtrace_enable_io_t args;
void *dof;
int n, err;
@ -159,7 +162,9 @@ dtrace_program_exec(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
if ((dof = dtrace_dof_create(dtp, pgp, DTRACE_D_STRIP)) == NULL)
return (-1);
n = dt_ioctl(dtp, DTRACEIOC_ENABLE, dof);
args.dof = dof;
args.n_matched = 0;
n = dt_ioctl(dtp, DTRACEIOC_ENABLE, &args);
dtrace_dof_destroy(dtp, dof);
if (n == -1) {
@ -181,7 +186,7 @@ dtrace_program_exec(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
}
if (pip != NULL)
pip->dpi_matches += n;
pip->dpi_matches += args.n_matched;
return (0);
}