summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2014-03-27 14:23:21 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-27 14:50:36 +0100
commit5c0c0cf2a6a9e3fdbcd1ada3f79399c453b1fbd1 (patch)
treedba573cb48c77127b711bdce1f94816025fdf942 /cpukit/include
parentprivateenv: Remove sharing of user environment between threads. (diff)
downloadrtems-5c0c0cf2a6a9e3fdbcd1ada3f79399c453b1fbd1.tar.bz2
privateenv: Use POSIX keys instead of task variables.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems/userenv.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/cpukit/include/rtems/userenv.h b/cpukit/include/rtems/userenv.h
index 8a9a4fcd32..631d773ae5 100644
--- a/cpukit/include/rtems/userenv.h
+++ b/cpukit/include/rtems/userenv.h
@@ -66,8 +66,17 @@ typedef struct {
pid_t pgrp; /* process group id */
} rtems_user_env_t;
-extern rtems_user_env_t * rtems_current_user_env;
-extern rtems_user_env_t rtems_global_user_env;
+extern rtems_user_env_t rtems_global_user_env;
+
+/**
+ * @brief Fetch the pointer to the current user environment.
+ *
+ * If the task has a private user environment the pointer to it will be
+ * returned. Otherwise the pointer to rtems_global_user_env will be returned.
+ */
+rtems_user_env_t * rtems_current_user_env_get(void);
+
+#define rtems_current_user_env rtems_current_user_env_get()
#define rtems_filesystem_current (rtems_current_user_env->current_directory)
#define rtems_filesystem_root (rtems_current_user_env->root_directory)
@@ -86,6 +95,11 @@ extern rtems_user_env_t rtems_global_user_env;
* function must be called from normal thread context and may block on a mutex.
* Thread dispatching is disabled to protect some critical sections.
*
+ * The private environment internally uses a POSIX key. The key is added to the
+ * configuration implicitly. But for each thread that uses a private environment
+ * a key value pair has to be configured by the application. If only the global
+ * environment is used there is no need to configure a key value pair.
+ *
* @retval RTEMS_SUCCESSFUL Successful operation.
* @retval RTEMS_NO_MEMORY Not enough memory.
* @retval RTEMS_UNSATISFIED Cloning of the current environment failed.