This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
file stat mode bits and compatibility
- From: Rutger Hofman <rutger at cs dot vu dot nl>
- To: eCos Discuss List <ecos-discuss at ecos dot sourceware dot org>
- Date: Sat, 10 Oct 2009 15:58:36 +0200
- Subject: [ECOS] file stat mode bits and compatibility
I wanted to share a YAFFS file system between my eCos application and my
u-boot bootloader. Well, since the NAND flash implementations eCos has
YAFFS, and u-boot has it too. I ran into a problem when sharing a YAFFS
file system. The single incompatibility issue is the value of file stat
mode bits. E.g., u-boot has S_IRUSR = S_IREAD = (1<<8) but eCos has
(1<<16). Now, this incompatibility will not only bite me, but anyone who
wants to share a YAFFS file system between RedBoot and Linux or whatever
combination of systems. There seems to be no hook in YAFFS to disable
the permissions altogether.
POSIX does not appear to prescribe values for these bits
(http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/stat.h.html),
so an implementation appears free to choose them. A short investigation
showed that Linux, Solaris, and M$ Visual C++ all have chosen the same
values as u-boot, which makes eCos the odd one out.
Just changing the eCos mode bit definitions will render existing file
systems unusable. So, this proposal: introduce a .cdl option
CYGBLD_ISO_STAT_MODE_COMPATIBILITY in isoinfra.cdl which, when enabled,
has the mode bit definitions like Linux, u-boot, and the rest; and when
disabled (as by default?), has the old situation.
Enabling this stat mode compatibility made the YAFFS file system fully
accessible between u-boot and eCos.
What is the opinion of the list?
If people agree, shall I submit a patch to the ecos-patches list?
Rutger Hofman
VU Amsterdam
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss