From fb6bdf408d66bfc213293a418a6388cfd1b9180d Mon Sep 17 00:00:00 2001
From: patacongo
Gregory Nutt
-Last Update: July 20, 2008
+Last Update: August 10, 2008
Overview.
NuttX includes an optional, scalable file system.
@@ -5971,9 +5980,9 @@ interface of the same name.
int statfs(const char *path, FAR struct statfs *buf); /* Prototyped but not implemented */
-
Function Prototype:
1.0 Introduction
@@ -5843,7 +5843,16 @@ interface of the same name.
2.11 File System Interfaces
-Overview
+
+
+
+2.11.1 NuttX File System Overview
2.11.4 Pipes and FIFOs
+2.11.5 Pipes and FIFOs
-2.11.4.1
+pipe2.11.5.1
pipe
mkfifomkfifoFunction Prototype:
@@ -6054,22 +6063,25 @@ interface of the same name. -setenvmkfatfsFunction Prototype:
-- #include+- int setenv(const char *name, const char *value, int overwrite); -
+#include+int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt); +
Description:
- The setenv() function adds the variable name to the environment with the
- specified value if the variable name does not exist. If the name
- does exist in the environment, then its value is changed to value if overwrite
- is non-zero; if overwrite is zero, then the value of name is unaltered.
+ The mkfafs() formats a FAT file system image on the block
+ device specified by pathname
+
Assumptions: The caller must assure that the block driver is not mounted and not in + use when this function is called. + The result of formatting a mounted device is indeterminate (but likely not good).
name
- The name of the variable to change.
+ pathname
+ The full path to the registered block driver in the file system.
value
- The new value of the variable.
- value
- Replace any existing value if non-zero.
+ fmt
+ A reference to an instance of a structure that provides caller-selectable
+ attributes of the created FAT file system.
+
+struct fat_format_s
+{
+ ubyte ff_nfats; /* Number of FATs */
+ ubyte ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */
+ ubyte ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */
+ ubyte ff_volumelabel[11]; /* Volume label */
+ uint16 ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/
+ uint16 ff_rootdirentries; /* Number of root directory entries */
+ uint16 ff_rsvdseccount; /* Reserved sectors */
+ uint32 ff_hidsec; /* Count of hidden sectors preceding fat */
+ uint32 ff_volumeid; /* FAT volume id */
+ uint32 ff_nsectors; /* Number of sectors from device to use: 0: Use all */
+};
+
+
- Zero on success.
+ Zero (OK) on success;
+ -1 (ERROR) on failure with errno set appropriately:
+
EINVAL -
+ NULL block driver string, bad number of FATS in fmt,
+ bad FAT size in fmt, bad cluster size in fmt
+ ENOENT -
+ pathname does not refer to anything in the filesystem.
+ ENOTBLK -
+ pathname does not refer to a block driver
+ EACCESS -
+ block driver does not support write or geometry methods
+ | + |
|
-+ |
+ |