summaryrefslogtreecommitdiffstats
path: root/c/src/lib/include/rtems/libio_.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-01-25 15:59:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-01-25 15:59:58 +0000
commit2a929cc87152fc499715d43a808e7cb78c2e01cf (patch)
treecfde4180861d5364a822da07e6bbd6a8d8ae5be0 /c/src/lib/include/rtems/libio_.h
parent2001-01-25 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-2a929cc87152fc499715d43a808e7cb78c2e01cf.tar.bz2
2001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>
* Alternate email is correo@fernando-ruiz.com * libc/privateenv.c: New file. * include/rtems/libio_.h, libc/Makefile.am, libc/base_fs.c, libc/unmount.c: Moved default umask, current working directory, root, and links followed count into a structure "user environment" that can then be treated as a unit. This enable giving unique copies of these to individual threads or collection of threads.
Diffstat (limited to '')
-rw-r--r--c/src/lib/include/rtems/libio_.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/c/src/lib/include/rtems/libio_.h b/c/src/lib/include/rtems/libio_.h
index 008c7c3fb7..cda8faacf5 100644
--- a/c/src/lib/include/rtems/libio_.h
+++ b/c/src/lib/include/rtems/libio_.h
@@ -65,12 +65,6 @@ extern rtems_libio_t *rtems_libio_last_iop;
extern rtems_libio_t *rtems_libio_iop_freelist;
/*
- * Default mode for all files.
- */
-
-extern mode_t rtems_filesystem_umask;
-
-/*
* set_errno_and_return_minus_one
*
* Macro to ease common way to return an error.
@@ -214,10 +208,27 @@ extern mode_t rtems_filesystem_umask;
/*
* External structures
*/
+typedef struct {
+ rtems_filesystem_location_info_t current_directory;
+ rtems_filesystem_location_info_t root_directory;
+ /* Default mode for all files. */
+ mode_t umask;
+ nlink_t link_counts;
+} rtems_user_env_t;
+
+extern rtems_user_env_t * rtems_current_user_env;
+extern rtems_user_env_t rtems_global_user_env;
+
+#define rtems_filesystem_current (rtems_current_user_env->current_directory)
+#define rtems_filesystem_root (rtems_current_user_env->root_directory)
+#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
+#define rtems_filesystem_umask (rtems_current_user_env->umask)
+
+/*
+ * Instantiate a private copy of the per user information for the calling task.
+ */
-extern rtems_filesystem_location_info_t rtems_filesystem_current;
-extern rtems_filesystem_location_info_t rtems_filesystem_root;
-extern nlink_t rtems_filesystem_link_counts;
+rtems_status_code rtems_libio_set_private_env(void);
/*