[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Date: Fri, 25 Oct 2002 19:09:31 -0700
- From: strauman at SLAC.Stanford.EDU (Till Straumann)
- Subject: rtems_filesystem_current issues
I spent the last week implementing NFS (client) support for RTEMS.
The implementation can't avoid attaching dynamical information to
the 'node_access' field of rtems_filesystem_location_info_t
This introduces subtle problems with the more or less global
variables. In particular, they must not be copied without properly
allocating a new node nor released without calling
While the generic FS code seems to be pretty clean (fchdir() and
chroot() are the exceptions [I'll submit patches/PRs ASAP]) in
this respect - there are more problems with the 'userenv'
Wouldn't it make more sense to make the 'current' and 'root'
locations part of the C-library's per-thread 'reent' structure?
IMO, the current solution (they are part of the 'userenv') is not
a good one. Sharing the path variables is _not_thread_safe_ and
hence it would be better to explicitely having to ask for sharing
them (threads who do so are then responsible for proper
locking etc.) and implicitely getting a private copy rather than the other
Ideally, sharing these path locations should be avoided at all
(otherwise, the need for reference counts etc. arises).