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/a0a87190fad1
branches:  trunk
changeset: 815040:a0a87190fad1
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 5be3cb1ebcdb -r a0a87190fad1 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