summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/sys_process.c7
-rw-r--r--sys/sys/ptrace.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 9dad83a..7063ed3 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -807,6 +807,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
else
pl->pl_event = 0;
}
+ if (td2->td_pflags & TDP_SA) {
+ pl->pl_flags = PL_FLAG_SA;
+ if (td2->td_upcall && !TD_CAN_UNBIND(td2))
+ pl->pl_flags |= PL_FLAG_BOUND;
+ } else {
+ pl->pl_flags = 0;
+ }
_PRELE(p);
PROC_UNLOCK(p);
return (0);
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
index e9493d3..5596790 100644
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -89,6 +89,9 @@ struct ptrace_lwpinfo {
int pl_event; /* Event that stopped the LWP. */
#define PL_EVENT_NONE 0
#define PL_EVENT_SIGNAL 1
+ int pl_flags; /* LWP flags. */
+#define PL_FLAG_SA 0x01 /* M:N thread */
+#define PL_FLAG_BOUND 0x02 /* M:N bound thread */
};
#ifdef _KERNEL
OpenPOWER on IntegriCloud