summaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-09 00:26:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-09 00:26:52 +0000
commit04701a1a031e14674a6f98f235b84f60e27b139a (patch)
tree469d23ab3e3694e0d0ccad47675130074f6d29b1 /apps/examples
parent3219f837f162088ad89b2102d1fcf71b293c14fc (diff)
downloadpx4-nuttx-04701a1a031e14674a6f98f235b84f60e27b139a.tar.gz
px4-nuttx-04701a1a031e14674a6f98f235b84f60e27b139a.tar.bz2
px4-nuttx-04701a1a031e14674a6f98f235b84f60e27b139a.zip
STM32F3Discovery passes all OS tests; Delay loop has been calibrated
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5629 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/ostest/waitpid.c93
1 files changed, 84 insertions, 9 deletions
diff --git a/apps/examples/ostest/waitpid.c b/apps/examples/ostest/waitpid.c
index d45410265..67cd81fdc 100644
--- a/apps/examples/ostest/waitpid.c
+++ b/apps/examples/ostest/waitpid.c
@@ -110,8 +110,23 @@ static void waitpid_last(void)
if (ret < 0)
{
int errcode = errno;
- printf("waitpid_last: ERROR: PID %d waitpid failed: %d\n",
- g_waitpids[NCHILDREN-1], errcode);
+
+ /* Unfortunately, this main thread does not retain child status. If
+ * child status is enabled (via CONFIG_SCHED_CHILD_STATUS), ostest_main()
+ * disables the feature by calling sigactin with SA_NOCLDWAIT.
+ */
+
+ if (errcode == ECHILD)
+ {
+ printf("waitpid_last: PASS: PID %d waitpid failed with ECHILD. That may be\n",
+ g_waitpids[NCHILDREN-1]);
+ printf(" acceptable because child status is disabled on this thread.\n");
+ }
+ else
+ {
+ printf("waitpid_last: ERROR: PID %d waitpid failed: %d\n",
+ g_waitpids[NCHILDREN-1], errcode);
+ }
}
else if (WEXITSTATUS(stat_loc) != RETURN_STATUS)
{
@@ -120,7 +135,7 @@ static void waitpid_last(void)
}
else
{
- printf("waitpid_last: PID %d waitpid succeeded with stat_loc=%04x\n",
+ printf("waitpid_last: PASS: PID %d waitpid succeeded with stat_loc=%04x\n",
g_waitpids[NCHILDREN-1], stat_loc);
}
}
@@ -147,8 +162,23 @@ int waitpid_test(void)
if (ret < 0)
{
int errcode = errno;
- printf("waitpid_test: ERROR: PID %d waitpid failed: %d\n",
- g_waitpids[0], errcode);
+
+ /* Unfortunately, this main thread does not retain child status. If
+ * child status is enabled (via CONFIG_SCHED_CHILD_STATUS), ostest_main()
+ * disables the feature by calling sigactin with SA_NOCLDWAIT.
+ */
+
+ if (errcode == ECHILD)
+ {
+ printf("waitpid_test: PASS: PID %d waitpid failed with ECHILD. That may be\n",
+ g_waitpids[NCHILDREN-1]);
+ printf(" acceptable because child status is disabled on this thread.\n");
+ }
+ else
+ {
+ printf("waitpid_test: ERROR: PID %d waitpid failed: %d\n",
+ g_waitpids[0], errcode);
+ }
}
else if (ret != g_waitpids[0])
{
@@ -182,8 +212,23 @@ int waitpid_test(void)
if (ret < 0)
{
int errcode = errno;
- printf("waitpid_test: ERROR: PID %d waitid failed: %d\n",
- g_waitpids[0], errcode);
+
+ /* Unfortunately, this main thread does not retain child status. If
+ * child status is enabled (via CONFIG_SCHED_CHILD_STATUS), ostest_main()
+ * disables the feature by calling sigactin with SA_NOCLDWAIT.
+ */
+
+ if (errcode == ECHILD)
+ {
+ printf("waitpid_test: PASS: PID %d waitpid failed with ECHILD. That may be\n",
+ g_waitpids[NCHILDREN-1]);
+ printf(" acceptable because child status is disabled on this thread.\n");
+ }
+ else
+ {
+ printf("waitpid_test: ERROR: PID %d waitid failed: %d\n",
+ g_waitpids[0], errcode);
+ }
}
else if (info.si_pid != g_waitpids[0])
{
@@ -216,7 +261,22 @@ int waitpid_test(void)
if (ret < 0)
{
int errcode = errno;
- printf("waitpid_test: ERROR: waitid failed: %d\n", errcode);
+
+ /* Unfortunately, this main thread does not retain child status. If
+ * child status is enabled (via CONFIG_SCHED_CHILD_STATUS), ostest_main()
+ * disables the feature by calling sigactin with SA_NOCLDWAIT.
+ */
+
+ if (errcode == ECHILD)
+ {
+ printf("waitpid_test: PASS: PID %d waitpid failed with ECHILD. That may be\n",
+ g_waitpids[NCHILDREN-1]);
+ printf(" acceptable because child status is disabled on this thread.\n");
+ }
+ else
+ {
+ printf("waitpid_test: ERROR: waitid failed: %d\n", errcode);
+ }
}
else if (info.si_status != RETURN_STATUS)
{
@@ -244,7 +304,22 @@ int waitpid_test(void)
if (ret < 0)
{
int errcode = errno;
- printf("waitpid_test: ERROR: wait failed: %d\n", errcode);
+
+ /* Unfortunately, this main thread does not retain child status. If
+ * child status is enabled (via CONFIG_SCHED_CHILD_STATUS), ostest_main()
+ * disables the feature by calling sigactin with SA_NOCLDWAIT.
+ */
+
+ if (errcode == ECHILD)
+ {
+ printf("waitpid_test: PASS: PID %d waitpid failed with ECHILD. That may be\n",
+ g_waitpids[NCHILDREN-1]);
+ printf(" acceptable because child status is disabled on this thread.\n");
+ }
+ else
+ {
+ printf("waitpid_test: ERROR: wait failed: %d\n", errcode);
+ }
}
else if (WEXITSTATUS(stat_loc) != RETURN_STATUS)
{