summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/common
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-29 10:59:15 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-29 10:59:15 -0600
commitde628f032a8f9f307d02dfd13d86e395bb6c8c8e (patch)
treefa0e5d097c08bc29469fc0720063bac03d6b23a4 /nuttx/arch/arm/src/common
parent080fe9dcd96388dde46e6f0fbac3090ab8be7c17 (diff)
downloadnuttx-de628f032a8f9f307d02dfd13d86e395bb6c8c8e.tar.gz
nuttx-de628f032a8f9f307d02dfd13d86e395bb6c8c8e.tar.bz2
nuttx-de628f032a8f9f307d02dfd13d86e395bb6c8c8e.zip
More vfork(): If we get to vfork() via system call, then we need to clone some system call information so that the return form the cloned system call works correctly
Diffstat (limited to 'nuttx/arch/arm/src/common')
-rw-r--r--nuttx/arch/arm/src/common/up_vfork.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/common/up_vfork.c b/nuttx/arch/arm/src/common/up_vfork.c
index b578bd027..a11c3b94f 100644
--- a/nuttx/arch/arm/src/common/up_vfork.c
+++ b/nuttx/arch/arm/src/common/up_vfork.c
@@ -227,6 +227,26 @@ pid_t up_vfork(const struct vfork_s *context)
child->cmn.xcp.regs[REG_FP] = newfp; /* Frame pointer */
child->cmn.xcp.regs[REG_SP] = newsp; /* Stack pointer */
+#ifdef CONFIG_LIB_SYSCALL
+ /* If we got here via a syscall, then we are going to have to setup some
+ * syscall return information as well.
+ */
+
+ if (parent->xcp.nsyscalls > 0)
+ {
+ int index;
+ for (index = 0; index < parent->xcp.nsyscalls; index++)
+ {
+ child->cmn.xcp.syscall[index].sysreturn =
+ parent->xcp.syscall[index].sysreturn;
+ child->cmn.xcp.syscall[index].excreturn =
+ parent->xcp.syscall[index].excreturn;
+ }
+
+ child->cmn.xcp.nsyscalls = parent->xcp.nsyscalls;
+ }
+#endif
+
/* And, finally, start the child task. On a failure, task_vforkstart()
* will discard the TCB by calling task_vforkabort().
*/