aboutsummaryrefslogtreecommitdiff
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
commit66cdd288ab6a4d19c67300a73a26e9ee5a958187 (patch)
treeb5cbba4326a2edbbb9b1723492e38a408fcb3241 /nuttx/sched/task_vfork.c
parenta5f001189e1a056be275e1d736e38893f96cd395 (diff)
downloadpx4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.tar.gz
px4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.tar.bz2
px4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.zip
Add ostest vfork test (does not work yet)
git-svn-id: http://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);