diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2003-01-03 18:14:09 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2003-01-03 18:14:09 +0000 |
commit | f6161c72d1810db34f83d4570906859fc432e506 (patch) | |
tree | e68c31f866ef1a48cce276c2aacae038639c43d1 /cpukit/libcsupport/src/base_fs.c | |
parent | 2002-11-26 Chris Johns <cjohns@cybertec.com.au> (diff) | |
download | rtems-f6161c72d1810db34f83d4570906859fc432e506.tar.bz2 |
2003-01-03 Till Straumann <strauman@slac.stanford.edu>
* ChangeLog, base_fs.c, getpwent.c, privateenv.c
Per PR303, Fix violation of node_access copy syemantics
Diffstat (limited to 'cpukit/libcsupport/src/base_fs.c')
-rw-r--r-- | cpukit/libcsupport/src/base_fs.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/base_fs.c b/cpukit/libcsupport/src/base_fs.c index 119f38d794..61151eef07 100644 --- a/cpukit/libcsupport/src/base_fs.c +++ b/cpukit/libcsupport/src/base_fs.c @@ -49,6 +49,7 @@ void rtems_filesystem_initialize( void ) int status; rtems_filesystem_mount_table_entry_t *entry; rtems_filesystem_mount_table_t *mt; + rtems_filesystem_location_info_t loc; /* * Set the default umask to "022". @@ -75,8 +76,38 @@ void rtems_filesystem_initialize( void ) rtems_fatal_error_occurred( 0xABCD0002 ); rtems_filesystem_link_counts = 0; + + /* setup the 'current' and 'root' directories + * + * NOTE: cloning the pathlocs is not strictly + * necessary. Since we implicitely let + * all threads that don't call + * libio_set_private_env() share the same + * (initial) 'root' and 'current' locs, + * we (also implicitely) assume that the + * root filesystem doesn't care about + * reference counts. + * I just inserted the code snippet below + * to remind everybody of the fact by + * making it more explicit... + * Ideally, every thread would have to + * call either share_private_env() or + * set_private_env() - but then: that's + * gonna hit performance. + * + * Till Straumann, 10/25/2002 + */ rtems_filesystem_root = entry->mt_fs_root; - rtems_filesystem_current = rtems_filesystem_root; + /* Clone the root pathloc */ + rtems_filesystem_evaluate_path("/", 0, &loc, 0); + rtems_filesystem_root = loc; + /* One more clone for the current node */ + rtems_filesystem_evaluate_path("/", 0, &loc, 0); + rtems_filesystem_current = loc; + + /* Note: the global_env's refcnt doesn't matter + * as the global env is never released + */ /* |