xiaoxiang781216 commented on code in PR #20468:
URL: https://github.com/apache/nuttx/pull/20468#discussion_r4199797727
##########
binfmt/binfmt_execmodule.c:
##########
@@ -133,6 +134,30 @@ static void exec_swap(FAR struct tcb_s *ptcb, FAR struct
tcb_s *chtcb)
leave_critical_section(flags);
}
+/****************************************************************************
+ * Name: exec_swap_tls
+ *
+ * Description:
+ * Copy the pid that exec_swap() gave a task into its TLS, where getpid()
+ * and gettid() read it. The task's address environment must be current.
+ *
+ * Input Parameters:
+ * tcb - The task whose pid changed.
+ *
+ * Returned Value:
+ * none
+ *
+ ****************************************************************************/
+
+static void exec_swap_tls(FAR struct tcb_s *tcb)
+{
+ FAR struct tls_info_s *info = (FAR struct tls_info_s *)
+ tcb->stack_alloc_ptr;
+
+ tcb->group->tg_info->ta_pid = tcb->group->tg_pid;
+ info->tl_tid = tcb->pid;
Review Comment:
merge into exec_swap
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]