PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT are undocumented, I don't believe it's by design.
The only place these are used is gnu/usr.bin/binutils/gdb/obsd-nat.c Index: ptrace.2 =================================================================== RCS file: /cvs/src/lib/libc/sys/ptrace.2,v retrieving revision 1.35 diff -u -p -r1.35 ptrace.2 --- ptrace.2 1 Dec 2015 07:50:03 -0000 1.35 +++ ptrace.2 5 Mar 2016 08:02:24 -0000 @@ -301,6 +301,28 @@ The .Fa data argument should be set to .Li sizeof(struct ptrace_state) . +.It Dv PT_GET_THREAD_FIRST +This request reads the thread ID of the traced process' first thread into the +.Dq Li struct ptrace_thread_state +pointed to by +.Fa addr . +The +.Fa data +argument should be set to +.Li sizeof(struct ptrace_thread_state) . +.It Dv PT_GET_THREAD_NEXT +This request is just like +.Dv PT_GET_THREAD_FIRST , +except it returns the thread ID of the subsequent thread. +The +.Dq Li struct ptrace_thread_state +pointed to by +.Fa addr +must be initialized by a previous +.Dv PT_GET_THREAD_FIRST +or +.Dv PT_GET_THREAD_NEXT +request. .El .Pp Additionally, machine-specific requests can exist. -- Michal Mazurek
