Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/libproc/dist the netbsd version of PT_LWPINFO i...



details:   https://anonhg.NetBSD.org/src/rev/ca2ddc0e699a
branches:  trunk
changeset: 344898:ca2ddc0e699a
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Apr 26 14:29:58 2016 +0000

description:
the netbsd version of PT_LWPINFO is different from the freebsd version
in that we use lp_lwpid as an input to say which lwp to operate on.
freebsd passes the lwpid as the pid, which works fine there
since freebsd has globally unique LWP IDs which are also distinct
from process IDs.  the libproc interface that uses this ptrace() call
is only supposed to return info for the process's representative LWP,
so just initialize pl_lwpid to 1 before using it.

diffstat:

 external/bsd/libproc/dist/proc_util.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 5f3edeeac8e7 -r ca2ddc0e699a external/bsd/libproc/dist/proc_util.c
--- a/external/bsd/libproc/dist/proc_util.c     Tue Apr 26 14:28:39 2016 +0000
+++ b/external/bsd/libproc/dist/proc_util.c     Tue Apr 26 14:29:58 2016 +0000
@@ -219,6 +219,7 @@
 
        if (phdl == NULL)
                return (NULL);
+       lwpinfo.pl_lwpid = 1;
        if (ptrace(PT_LWPINFO, phdl->pid, (void *)&lwpinfo,
            sizeof(lwpinfo)) < 0)
                return (NULL);



Home | Main Index | Thread Index | Old Index