Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/lib/libdtrace/common Try to load mo...



details:   https://anonhg.NetBSD.org/src/rev/2c3a02a0de4a
branches:  trunk
changeset: 962432:2c3a02a0de4a
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Jul 21 15:37:27 2019 +0000

description:
Try to load module "dtrace" before opening "/dev/dtrace/dtrace".

Fixes PR kern/54387: DTrace Kernel module does not autoload on first use ...

diffstat:

 external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 408aeab7b5fe -r 2c3a02a0de4a external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c
--- a/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c   Sun Jul 21 15:25:59 2019 +0000
+++ b/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c   Sun Jul 21 15:37:27 2019 +0000
@@ -1140,6 +1140,16 @@
         */
        dt_provmod_open(&provmod, &df);
 
+#ifdef __NetBSD__
+       modctl_load_t cmdargs;
+
+       cmdargs.ml_filename = "dtrace";
+       cmdargs.ml_flags = MODCTL_NO_PROP;
+       cmdargs.ml_props = NULL;
+       cmdargs.ml_propslen = 0;
+
+       (void)modctl(MODCTL_LOAD, &cmdargs);
+#endif
        dtfd = open("/dev/dtrace/dtrace", O_RDWR);
        err = errno; /* save errno from opening dtfd */
 #if defined(__FreeBSD__)



Home | Main Index | Thread Index | Old Index