summaryrefslogtreecommitdiff
path: root/nuttx/sched/task_vfork.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-07 21:41:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-07 21:41:20 +0000
commit89f3c966e75b483eaeb4af2a85721f9b1d8ed4e2 (patch)
treeb5cbba4326a2edbbb9b1723492e38a408fcb3241 /nuttx/sched/task_vfork.c
parent8514e37561246aee4dfbf569b474663aca368913 (diff)
downloadpx4-nuttx-89f3c966e75b483eaeb4af2a85721f9b1d8ed4e2.tar.gz
px4-nuttx-89f3c966e75b483eaeb4af2a85721f9b1d8ed4e2.tar.bz2
px4-nuttx-89f3c966e75b483eaeb4af2a85721f9b1d8ed4e2.zip
Add ostest vfork test (does not work yet)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5488 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_vfork.c')
-rw-r--r--nuttx/sched/task_vfork.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nuttx/sched/task_vfork.c b/nuttx/sched/task_vfork.c
index 93fcb46da..64f6f0636 100644
--- a/nuttx/sched/task_vfork.c
+++ b/nuttx/sched/task_vfork.c
@@ -43,6 +43,7 @@
#include <assert.h>
#include <queue.h>
#include <errno.h>
+#include <debug.h>
#include <nuttx/sched.h>
@@ -151,12 +152,14 @@ FAR _TCB *task_vforksetup(start_t retaddr)
/* Initialize the task control block. This calls up_initial_state() */
+ svdbg("Child priority=%d start=%p\n", priority, retaddr);
ret = task_schedsetup(child, priority, retaddr, parent->entry.main);
if (ret != OK)
{
goto errout_with_tcb;
}
+ svdbg("parent=%p, returning child=%p\n", parent, child);
return child;
errout_with_tcb:
@@ -210,10 +213,14 @@ errout_with_tcb:
pid_t task_vforkstart(FAR _TCB *child)
{
+#if CONFIG_TASK_NAME_SIZE > 0
+ _TCB *parent = (FAR _TCB *)g_readytorun.head;
+#endif
FAR const char *name;
pid_t pid;
int ret;
+ svdbg("Starting Child TCB=%p, parent=%p\n", child, g_readytorun.head);
DEBUGASSERT(child);
/* Setup to pass parameters to the new task */
@@ -221,7 +228,7 @@ pid_t task_vforkstart(FAR _TCB *child)
#if CONFIG_TASK_NAME_SIZE > 0
name = parent->name;
#else
- name = "<noname>";
+ name = NULL;
#endif
(void)task_argsetup(child, name, (const char **)NULL);