PERFORCE change 96105 for review
John Birrell
jb at FreeBSD.org
Tue Apr 25 20:52:33 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96105
Change 96105 by jb at jb_freebsd2 on 2006/04/25 20:51:33
SysV -> BSD style ioctl for DOFGET.
Affected files ...
.. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_options.c#3 edit
.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#7 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#9 edit
Differences ...
==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_options.c#3 (text) ====
@@ -788,7 +788,12 @@
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))
@@ -801,7 +806,11 @@
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++) {
==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#7 (text+ko) ====
@@ -287,15 +287,13 @@
return (0);
}
- case DTRACEIOC_DOFGET:
-printf("DTRACEIOC_DOFGET:\n");
-error = EINVAL;
-#ifdef DOODAD
- {
- dof_hdr_t hdr, *dof;
+ case DTRACEIOC_DOFGET: {
+ dof_hdr_t **pdof = (dof_hdr_t **) addr;
+ dof_hdr_t hdr, *dof = *pdof;
+ int rval;
uint64_t len;
- if (copyin((void *)arg, &hdr, sizeof (hdr)) != 0)
+ if (copyin((void *)dof, &hdr, sizeof (hdr)) != 0)
return (EFAULT);
mutex_enter(&dtrace_lock);
@@ -303,13 +301,11 @@
mutex_exit(&dtrace_lock);
len = MIN(hdr.dofh_loadsz, dof->dofh_loadsz);
- rval = copyout(dof, (void *)arg, len);
+ rval = copyout(dof, (void *) *pdof, len);
dtrace_dof_destroy(dof);
return (rval == 0 ? 0 : EFAULT);
}
-#endif
- break;
case DTRACEIOC_ENABLE: {
dof_hdr_t *dof = NULL;
dtrace_enabling_t *enab = NULL;
==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#9 (text) ====
@@ -1221,7 +1221,8 @@
#define DTRACEIOC_STOP _IO('x',13) /* stop tracing */
#define DTRACEIOC_AGGDESC _IO('x',15) /* get agg. desc. */
#define DTRACEIOC_FORMAT _IO('x',16) /* get format str */
-#define DTRACEIOC_DOFGET _IO('x',17) /* get DOF */
+#define DTRACEIOC_DOFGET _IOW('x',17,dof_hdr_t *)
+ /* get DOF */
#define DTRACEIOC_REPLICATE _IO('x',18) /* replicate enab */
#endif
More information about the p4-projects
mailing list