RTEMS 6.1-rc1
|
File System Mount Functions. More...
Files | |
file | fsmount.c |
File System Mount Functions. | |
Data Structures | |
struct | rtems_fstab_entry |
Enumerations | |
enum | rtems_fstab_conditions { RTEMS_FSTAB_NONE = 0U , RTEMS_FSTAB_OK = 0x1U , RTEMS_FSTAB_ERROR_MOUNT_POINT = 0x2U , RTEMS_FSTAB_ERROR_MOUNT = 0x4U , RTEMS_FSTAB_ERROR = RTEMS_FSTAB_ERROR_MOUNT_POINT | RTEMS_FSTAB_ERROR_MOUNT , RTEMS_FSTAB_ANY = RTEMS_FSTAB_OK | RTEMS_FSTAB_ERROR } |
Functions | |
int | rtems_fsmount (const rtems_fstab_entry *fstab, size_t size, size_t *abort_index) |
Mounts the file systems listed in the file system mount table. More... | |
File System Mount Functions.
This file contains the fsmount functions. These functions
are used to mount a list of filesystems (and create their mount points before).
File system mount report and abort condition flags.
The flags define, which conditions will cause a report during the mount process (via printf()) or abort the mount process.
int rtems_fsmount | ( | const rtems_fstab_entry * | fstab, |
size_t | size, | ||
size_t * | abort_index | ||
) |
Mounts the file systems listed in the file system mount table.
Mounts the file systems listed in the file system mount table fstab of size size.
Each file system will be mounted according to its table entry parameters. In case of an abort condition the corresponding table index will be reported in abort_index. The pointer abort_index may be NULL
. The mount point paths will be created with rtems_mkdir() and need not exist beforehand.
On success, zero is returned. On error, -1 is returned, and errno
is set appropriately.
The following example code tries to mount a FAT file system within a SD Card. Some cards do not have a partition table so at first it tries to find a file system inside the hole disk. If this is successful the mount process will be aborted because the RTEMS_FSTAB_OK condition is true. If this did not work it tries to mount the file system inside the first partition. If this fails the mount process will not be aborted (this is already the last entry), but the last error status will be returned.