1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >File System Table</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="File System Support Infrastructure"
23 HREF="fileio.html"><LINK
26 HREF="fileio-intro.html"><LINK
29 HREF="fileio-mount-table.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="fileio-intro.html"
71 HREF="fileio-mount-table.html"
84 NAME="FILEIO-FSTAB">Chapter 20. File System Table</H1
86 >The filesystem table is an array of entries that describe each
87 filesystem implementation that is part of the system image. Each
88 resident filesystem should export an entry to this table using the
100 >At present we do not support dynamic addition or removal of table
101 entries. However, an API similar to <TT
105 allow new entries to be added to the table.</P
109 >The table entries are described by the following structure:</P
117 CLASS="PROGRAMLISTING"
118 >struct cyg_fstab_entry
120 const char *name; // filesystem name
121 CYG_ADDRWORD data; // private data value
122 cyg_uint32 syncmode; // synchronization mode
124 int (*mount) ( cyg_fstab_entry *fste, cyg_mtab_entry *mte );
125 int (*umount) ( cyg_mtab_entry *mte );
126 int (*open) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
127 int mode, cyg_file *fte );
128 int (*unlink) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
129 int (*mkdir) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
130 int (*rmdir) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
131 int (*rename) ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
132 cyg_dir dir2, const char *name2 );
133 int (*link) ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
134 cyg_dir dir2, const char *name2, int type );
135 int (*opendir) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
137 int (*chdir) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
139 int (*stat) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
141 int (*getinfo) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
142 int key, char *buf, int len );
143 int (*setinfo) ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
144 int key, char *buf, int len );
155 > field points to a string that
156 identifies this filesystem implementation. Typical values might be
157 "romfs", "msdos", "ext2" etc.</P
164 > field contains any private data
165 that the filesystem needs, perhaps the root of its data structures.</P
172 > field contains a description of
173 the locking protocol to be used when accessing this filesystem. It
174 will be described in more detail in <A
175 HREF="fileio-synchronization.html"
179 >The remaining fields are pointers to functions that implement
180 filesystem operations that apply to files and directories as whole
181 objects. The operation implemented by each function should be obvious
182 from the names, with a few exceptions:</P
187 > function pointer opens a directory
189 HREF="fileio-directories.html"
200 > function pointers provide support for
201 various minor control and information functions such as
210 >With the exception of the <TT
217 > functions, all of these functions
218 take three standard arguments, a pointer to a mount table entry (see
219 later) a directory pointer (also see later) and a file name relative
220 to the directory. These should be used by the filesystem to locate the
221 object of interest.</P
228 SUMMARY="Footer navigation table"
239 HREF="fileio-intro.html"
257 HREF="fileio-mount-table.html"