summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/condwait.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/condwait.c')
-rw-r--r--cpukit/posix/src/condwait.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/posix/src/condwait.c b/cpukit/posix/src/condwait.c
index 9a88287d0d..9527077757 100644
--- a/cpukit/posix/src/condwait.c
+++ b/cpukit/posix/src/condwait.c
@@ -20,6 +20,27 @@
#include <rtems/posix/condimpl.h>
+#include <string.h>
+
+bool _POSIX_Condition_variables_Auto_initialization(
+ POSIX_Condition_variables_Control *the_cond
+)
+{
+ POSIX_Condition_variables_Control zero;
+ unsigned long flags;
+
+ memset( &zero, 0, sizeof( zero ) );
+
+ if ( memcmp( the_cond, &zero, sizeof( *the_cond ) ) != 0 ) {
+ return false;
+ }
+
+ flags = (uintptr_t) the_cond ^ POSIX_CONDITION_VARIABLES_MAGIC;
+ flags &= ~POSIX_CONDITION_VARIABLES_FLAGS_MASK;
+ the_cond->flags = flags;
+ return true;
+}
+
/*
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
*/