In article <1180c509-ee6c-6fde-56fd-0e8cf01e6...@gmx.com>, Kamil Rytarowski <n...@gmx.com> wrote: >-=-=-=-=-=- >-=-=-=-=-=- > >On 03.11.2016 14:10, Joerg Sonnenberger wrote: >> On Tue, Nov 01, 2016 at 03:58:10PM +0100, Kamil Rytarowski wrote: >>> Which one is preferred for NetBSD? >> >> I'd go with neither, but base the new interface on FreeBSD's. >> PT_GETLWPS takes as argument: >> >> struct ptrace_getinfos_request { >> size_t allocated_lwps; >> size_t current_lwps; >> struct ptrace_lwpinfo[]; >> } >> >> The caller provides allocated_lwps and promises that the buffer can hold >> sizeof(ptrace_getinfos_request) + allocated_lwps * sizeof(ptrace_lwpinfo) >> byte. The kernel writes up to allocated_lwps entries and sets >> current_lwps to the current total number of lwps. The caller can then >> easily check how many entries it has to allocate and maybe repeat the >> request.
Before adding more PT_ stuff, we should see if libpthread_dbg (td_open() etc.) have enough stuff to support what you want. They do for gdb. This was written for SA threads because they were M:N threads but it still works. christos