From e155bf66dfc0d35aad24cbd35ffa82bfc57962cb Mon Sep 17 00:00:00 2001
From: patacongo Last Updated: June 9, 2007 Last Updated: June 30, 2007
Gregory Nutt
-Last Update: May 27, 2007
+Last Update: June 30, 2007
-Watchdog times execute in the context of the timer interrupt handler, but
-with the PIC/PID address environment that was in place when wd_start()
-was called.
+Watchdog times execute in the context of the timer interrupt handler.
Watchdog timers execute only once.
@@ -5502,6 +5501,272 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
Overview.
+ NuttX supports environment variables that can be used to control the behavior of programs.
+ In the spirit of NuttX the environment variable behavior attempts to emulate the behavior of
+ environment variables in the mulit-processing OS:
+ Programming Interfaces.
+ The following environment variable programming interfaces are provided by Nuttx and are
+ described in detail in the following paragraphs.
+ Disabling Environment Variable Support.
+ All support for environment variables can be disabled by setting
+ Function Prototype:
+
+ Description:
+ The
+ Input Parameters:
+
+
+ Returned Values:
+ The value of the valiable (read-only) or NULL on failure.
+
+ Function Prototype:
+
+ Description:
+ The
+ Input Parameters:
+
+
+ Returned Values:
+ Zero on sucess.
+
+ Function Prototype:
+
+ Description:
+ The
+ Input Parameters:
+ None
+
+ Returned Values:
+ Zero on success.
+
+ Function Prototype:
+
+ Description:
+ The
+ Input Parameters:
+
+
+ Returned Values:
+ Zero on success.
+
+ Function Prototype:
+
+ Description:
+ The
+ Input Parameters:
+
+
+ Returned Values:
+ Zero on success.
+
+ The NuttX filesystem is very simple; it does not involve any block drivers or
+ particular filesystem (like FAT or EXT2 etc.).
+ The NuttX filesystem simply supports a set a filesystem APIs
+ (
diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html
index 46b4b2be44..7f0b7e5bf0 100644
--- a/Documentation/NuttxUserGuide.html
+++ b/Documentation/NuttxUserGuide.html
@@ -21,7 +21,7 @@ User's Manual
NuttX RTOS
- 1.0 Introduction
@@ -53,7 +53,8 @@ Gregory Nutt
2.10 Environment Variables
+
+
+CONFIG_DISABLE_ENVIRONMENT
+ in the board configuration file.
+2.10.1
+getenv
+ #include
+getenv()
function searches the environment list for a string that
+ matches the string pointed to by name
.
+
+
+name
.
+ The name of the variable to find.
+ 2.10.2
+putenv
+ #include
+putenv()
function adds or changes the value of environment variables.
+ The argument string is of the form name=value. If name does not already
+ exist in the environment, then string is added to the environment. If
+ name does exist, then the value of name in the environment is changed to
+ value.
+
+
+string
+ name=value string describing the environment setting to add/modify.
+ 2.10.3
+clearenv
+ #include
+clearenv()
function clears the environment of all name-value pairs
+ and sets the value of the external variable environ to NULL.
+2.10.4
+setenv
+ #include
+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.
+
+
+name
+ The name of the variable to change.
+ value
+ The new value of the variable.
+ value
+ Replace any existing value if non-zero.
+ 2.10.5
+unsetenv
+ #include
+unsetenv()
function deletes the variable name
from the environment.
+
+
+name
+ The name of the variable to delete.
+ 2.11 Filesystem Interfaces
+open()
, close()
, read()
, write
, etc.)
+ and a registration mechanism that allows devices drivers to a associated with nodes
+ in a file-system-like name space.
+2.11.1 Driver Operations
+
+ #include <fcntl.h>
+ int open(const char *path, int oflag, ...);
+
+
+
+ #include <unistd.h>
+ int close(int fd);
+ int dup(int fildes);
+ int dup2(int fildes1, int fildes2);
+ off_t lseek(int fd, off_t offset, int whence);
+ int read(int fd, void *buf, unsigned int nbytes);
+ int unlink(const char *path);
+ int write(int fd, const void *buf, unsigned int nbytes);
+
+
+
+ #include <sys/ioctl.h>
+ int ioctl(int fd, int req, unsigned long arg);
+
+
+2.11.2 Directory Operations
+
+ #include <dirent.h>
+ int closedir(DIR *dirp);
+ FAR DIR *opendir(const char *path);
+ FAR struct dirent *readdir(FAR DIR *dirp);
+ int readdir_r(FAR DIR *dirp, FAR struct dirent *entry, FAR struct dirent **result);
+ void rewinddir(FAR DIR *dirp);
+ void seekdir(FAR DIR *dirp, int loc);
+ int telldir(FAR DIR *dirp);
+
+
+2.11.3 Standard I/O
+
+ #include <stdio.h>
+ int fclose(FILE *stream);
+ int fflush(FILE *stream);
+ int feof(FILE *stream); /* Prototyped but not implemented */
+ int ferror(FILE *stream); /* Prototyped but not implemented */
+ int fgetc(FILE *stream);
+ char *fgets(char *s, int n, FILE *stream);
+ FILE *fopen(const char *path, const char *type);
+ int fprintf(FILE *stream, const char *format, ...);
+ int fputc(int c, FILE *stream);
+ int fputs(const char *s, FILE *stream);
+ size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream);
+ int fseek(FILE *stream, long int offset, int whence); /* Prototyped but not implemented */
+ size_t fwrite(const void *ptr, size_t size, size_t n_items, FILE *stream);
+ char *gets(char *s);
+
+ int printf(const char *format, ...);
+ int puts(const char *s);
+ int rename(const char *source, const char *target);
+ int sprintf(char *dest, const char *format, ...);
+ int ungetc(int c, FILE *stream);
+ int vprintf(const char *s, va_list ap);
+ int vfprintf(FILE *stream, const char *s, va_list ap);
+ int vsprintf(char *buf, const char *s, va_list ap);
+
+ int chdir(const char *path); /* Prototyped but not implemented */
+ FILE *fdopen(int fd, const char *type);
+ 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 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 */
+
+
3.0 OS Data Structures
3.1 Scalar types
@@ -5704,87 +5969,6 @@ notify a task when a message is available on a queue.
have to do some redesign.
- The NuttX filesystem is very simple; it does not involve any block drivers or
- particular filesystem (like FAT or EXT2 etc.).
- The NuttX filesystem simply supports a set a filesystem APIs
- (open()
, close()
, read()
, write
, etc.)
- and a registration mechanism that allows devices drivers to a associated with nodes
- in a file-system-like name space.
-
- #include <fcntl.h> - int open(const char *path, int oflag, ...); -- -
- #include <unistd.h> - int close(int fd); - int dup(int fildes); - int dup2(int fildes1, int fildes2); - off_t lseek(int fd, off_t offset, int whence); - int read(int fd, void *buf, unsigned int nbytes); - int unlink(const char *path); - int write(int fd, const void *buf, unsigned int nbytes); -- -
- #include <sys/ioctl.h> - int ioctl(int fd, int req, unsigned long arg); -- -
- #include <dirent.h> - int closedir(DIR *dirp); - FAR DIR *opendir(const char *path); - FAR struct dirent *readdir(FAR DIR *dirp); - int readdir_r(FAR DIR *dirp, FAR struct dirent *entry, FAR struct dirent **result); - void rewinddir(FAR DIR *dirp); - void seekdir(FAR DIR *dirp, int loc); - int telldir(FAR DIR *dirp); -- -
- #include <stdio.h> - int fclose(FILE *stream); - int fflush(FILE *stream); - int feof(FILE *stream); /* Prototyped but not implemented */ - int ferror(FILE *stream); /* Prototyped but not implemented */ - int fgetc(FILE *stream); - char *fgets(char *s, int n, FILE *stream); - FILE *fopen(const char *path, const char *type); - int fprintf(FILE *stream, const char *format, ...); - int fputc(int c, FILE *stream); - int fputs(const char *s, FILE *stream); - size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream); - int fseek(FILE *stream, long int offset, int whence); /* Prototyped but not implemented */ - size_t fwrite(const void *ptr, size_t size, size_t n_items, FILE *stream); - char *gets(char *s); - - int printf(const char *format, ...); - int puts(const char *s); - int rename(const char *source, const char *target); - int sprintf(char *dest, const char *format, ...); - int ungetc(int c, FILE *stream); - int vprintf(const char *s, va_list ap); - int vfprintf(FILE *stream, const char *s, va_list ap); - int vsprintf(char *buf, const char *s, va_list ap); - - int chdir(const char *path); /* Prototyped but not implemented */ - FILE *fdopen(int fd, const char *type); - 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 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 */ --