From c421cdd92d8abebc5de9a343df2a301df05284cd Mon Sep 17 00:00:00 2001
From: patacongo Overview.
NuttX includes an optional, scalable file system.
This file-system may be omitted altogther; NuttX does not depend on the presence
@@ -5898,7 +5900,7 @@ interface of the same name.
in a file-system-like name space.
+ Function Prototype:
+
+ Description:
+
+ 2.11 File System Interfaces
+Overview
+
2.11.1 Driver Operations
+2.11.2 Driver Operations
#include <fcntl.h>
int open(const char *path, int oflag, ...);
@@ -5920,7 +5922,7 @@ interface of the same name.
int ioctl(int fd, int req, unsigned long arg);
-2.11.2 Directory Operations
+2.11.3 Directory Operations
#include <dirent.h>
int closedir(DIR *dirp);
@@ -5932,7 +5934,7 @@ interface of the same name.
int telldir(FAR DIR *dirp);
-2.11.3 Standard I/O
+2.11.4 Standard I/O
#include <stdio.h>
int fclose(FILE *stream);
@@ -5964,12 +5966,139 @@ interface of the same name.
int fstat(int fd, FAR struct stat *buf); /* Prototyped but not implemented */
char *getcwd(FAR char *buf, size_t size); /* Prototyped but not implemented */
int mkdir(const char *path, mode_t mode);
- int mkfifo(const char *path, mode_t mode);
int rmdir(const char *path);
int stat(const char *path, FAR struct stat *buf);
int statfs(const char *path, FAR struct statfs *buf); /* Prototyped but not implemented */
+2.11.4 Pipes and FIFOs
+
+2.11.4.1
+pipe
+ #include
+
+
+pipe()
creates a pair of file descriptors, pointing to a pipe inode, and
+ places them in the array pointed to by filedes
.
+ filedes[0]
is for reading, filedes[1]
is for writing.
+
+ Input Parameters: +
filedes[2]
. The user provided array in which to catch the pipe file descriptors.+ Returned Values: +
+ 0 is returned on success; otherwise, -1 is returned with errno
set appropriately.
+
mkfifo
+ Function Prototype: +
++ #include++ int mkfifo(FAR const char *pathname, mode_t mode); +
+ Description: +
+ mkfifo()
makes a FIFO device driver file with name pathname
.
+ Unlike Linux, a NuttX FIFO is not a special file type but simply a device driver instance.
+ mode
specifies the FIFO's permissions (but is ignored in the current implementation).
+
+ Once the FIFO has been created by mkfifo()
, any thread can open it for
+ reading or writing, in the same way as an ordinary file.
+ However, it must have been opened from both reading and writing before input or output can be performed.
+ This FIFO implementation will block all attempts to open a FIFO read-only until at least one thread has opened the FIFO for writing.
+
+ If all threads that write to the FIFO have closed, subsequent calls to read()
on the FIFO will return 0 (end-of-file).
+
+ Input Parameters: +
pathname
.
+ The full path to the FIFO instance to attach to or to create (if not already created).
+ mode.
+ Ignored for now
+
+ Returned Values: +
+ 0 is returned on success; otherwise, -1 is returned with errno
set appropriately.
+
setenv
+ Function Prototype: +
++ #include++ int setenv(const char *name, const char *value, int overwrite); +
+ 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.
+
+ Input Parameters: +
name
+ The name of the variable to change.
+ value
+ The new value of the variable.
+ value
+ Replace any existing value if non-zero.
+ + Returned Values: +
+ Zero on success. +
+NuttX includes a simple interface layer based on uIP (see http://www.sics.se). NuttX supports subset of a standard socket interface to uIP. @@ -6811,7 +6940,8 @@ notify a task when a message is available on a queue.