summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-28 16:50:07 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-28 16:50:07 -0600
commit4c24c7c4a741eaeffc76339f07076cdad7a36c56 (patch)
tree337a94000f0e849884e81e8ac2ee188bf0a38179
parente735773fe5ea269b43dbecb246cec846b3a0368e (diff)
downloadpx4-nuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.tar.gz
px4-nuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.tar.bz2
px4-nuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.zip
Clean up some naming: fd vs. fildes vs. filedes and filep vs filp
-rw-r--r--apps/examples/pipe/pipe_main.c28
-rw-r--r--apps/examples/pipe/redirect_test.c26
-rw-r--r--apps/system/readline/readline.c8
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html16
-rw-r--r--nuttx/Documentation/NuttxUserGuide.html604
-rw-r--r--nuttx/arch/arm/src/c5471/c5471_watchdog.c10
-rw-r--r--nuttx/arch/arm/src/common/up_exit.c6
-rw-r--r--nuttx/arch/arm/src/lpc2378/lpc23xx_io.c202
-rw-r--r--nuttx/arch/avr/src/common/up_exit.c6
-rw-r--r--nuttx/arch/hc/src/common/up_exit.c6
-rw-r--r--nuttx/arch/mips/src/common/up_exit.c6
-rw-r--r--nuttx/arch/rgmp/src/bridge.c20
-rw-r--r--nuttx/arch/sh/src/common/up_exit.c6
-rw-r--r--nuttx/arch/sim/src/up_devconsole.c8
-rw-r--r--nuttx/arch/x86/src/common/up_exit.c6
-rw-r--r--nuttx/arch/z16/src/common/up_exit.c6
-rw-r--r--nuttx/arch/z80/src/common/up_exit.c6
-rw-r--r--nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c14
-rw-r--r--nuttx/configs/sam4l-xplained/src/sam_slcd.c14
-rw-r--r--nuttx/configs/stm32ldiscovery/src/stm32_lcd.c14
-rw-r--r--nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c14
-rw-r--r--nuttx/configs/vsn/src/sif.c6
-rw-r--r--nuttx/drivers/bch/bchdev_driver.c41
-rw-r--r--nuttx/drivers/dev_null.c10
-rw-r--r--nuttx/drivers/dev_zero.c14
-rw-r--r--nuttx/drivers/pipes/pipe.c24
-rw-r--r--nuttx/fs/fs_dup.c10
-rw-r--r--nuttx/fs/fs_dup2.c12
-rw-r--r--nuttx/fs/fs_fdopen.c4
-rw-r--r--nuttx/fs/fs_filedup.c26
-rw-r--r--nuttx/fs/fs_filedup2.c20
-rw-r--r--nuttx/fs/fs_files.c17
-rw-r--r--nuttx/fs/fs_internal.h40
-rw-r--r--nuttx/fs/fs_lseek.c6
-rw-r--r--nuttx/include/nuttx/fs/fs.h34
-rw-r--r--nuttx/include/unistd.h52
-rw-r--r--nuttx/libc/misc/lib_init.c4
-rw-r--r--nuttx/libc/stdio/lib_fclose.c13
-rw-r--r--nuttx/libc/stdio/lib_fgets.c5
-rw-r--r--nuttx/libc/stdio/lib_fileno.c5
-rw-r--r--nuttx/libc/stdio/lib_fseek.c8
-rw-r--r--nuttx/libc/stdio/lib_ftell.c8
-rw-r--r--nuttx/libc/stdio/lib_libfflush.c6
-rw-r--r--nuttx/libc/stdio/lib_libflushall.c2
-rw-r--r--nuttx/libc/stdio/lib_libfread.c11
-rw-r--r--nuttx/libc/stdio/lib_libfwrite.c5
-rw-r--r--nuttx/libc/stdio/lib_ungetc.c4
-rw-r--r--nuttx/net/net_vfcntl.c20
48 files changed, 713 insertions, 720 deletions
diff --git a/apps/examples/pipe/pipe_main.c b/apps/examples/pipe/pipe_main.c
index 63a4f283f..9ada9af5f 100644
--- a/apps/examples/pipe/pipe_main.c
+++ b/apps/examples/pipe/pipe_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/pipe/pipe_main.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -74,7 +74,7 @@
int pipe_main(int argc, char *argv[])
{
- int filedes[2];
+ int fd[2];
int ret;
/* Test FIFO logic */
@@ -93,20 +93,20 @@ int pipe_main(int argc, char *argv[])
* only on open for read-only (see interlock_test()).
*/
- filedes[1] = open(FIFO_PATH1, O_WRONLY);
- if (filedes[1] < 0)
+ fd[1] = open(FIFO_PATH1, O_WRONLY);
+ if (fd[1] < 0)
{
fprintf(stderr, "pipe_main: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH1, errno);
return 2;
}
- filedes[0] = open(FIFO_PATH1, O_RDONLY);
- if (filedes[0] < 0)
+ fd[0] = open(FIFO_PATH1, O_RDONLY);
+ if (fd[0] < 0)
{
fprintf(stderr, "pipe_main: Failed to open FIFO %s for reading, errno=%d\n",
FIFO_PATH1, errno);
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
@@ -115,12 +115,12 @@ int pipe_main(int argc, char *argv[])
/* Then perform the test using those file descriptors */
- ret = transfer_test(filedes[0], filedes[1]);
- if (close(filedes[0]) != 0)
+ ret = transfer_test(fd[0], fd[1]);
+ if (close(fd[0]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
@@ -136,7 +136,7 @@ int pipe_main(int argc, char *argv[])
/* Test PIPE logic */
printf("\npipe_main: Performing pipe test\n");
- ret = pipe(filedes);
+ ret = pipe(fd);
if (ret < 0)
{
fprintf(stderr, "pipe_main: pipe failed with errno=%d\n", errno);
@@ -145,12 +145,12 @@ int pipe_main(int argc, char *argv[])
/* Then perform the test using those file descriptors */
- ret = transfer_test(filedes[0], filedes[1]);
- if (close(filedes[0]) != 0)
+ ret = transfer_test(fd[0], fd[1]);
+ if (close(fd[0]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
diff --git a/apps/examples/pipe/redirect_test.c b/apps/examples/pipe/redirect_test.c
index 26fe9bcaa..ddce093f1 100644
--- a/apps/examples/pipe/redirect_test.c
+++ b/apps/examples/pipe/redirect_test.c
@@ -79,7 +79,7 @@ static int redirect_reader(int argc, char *argv[])
int fdout;
int ret;
int nbytes = 0;
-
+
printf("redirect_reader: started with fdin=%s\n", argv[1]);
/* Convert the fdin to binary */
@@ -135,7 +135,7 @@ static int redirect_reader(int argc, char *argv[])
nbytes += ret;
/* Echo to stdout */
-
+
ret = write(1, buffer, ret);
if (ret < 0)
{
@@ -167,9 +167,9 @@ static int redirect_writer(int argc, char *argv[])
int fdout;
int nbytes = 0;
int ret;
-
+
fprintf(stderr, "redirect_writer: started with fdout=%s\n", argv[2]);
-
+
/* Convert the fdout to binary */
fdin = atoi(argv[1]);
@@ -252,29 +252,29 @@ int redirection_test(void)
char buffer2[8];
int readerid;
int writerid;
- int filedes[2];
+ int fd[2];
int ret;
sem_init(&g_rddone, 0, 0);
/* Create the pipe */
- ret = pipe(filedes);
+ ret = pipe(fd);
if (ret < 0)
{
fprintf(stderr, "redirection_test: pipe failed with errno=%d\n", errno);
return 5;
}
-
- sprintf(buffer1, "%d", filedes[0]);
+
+ sprintf(buffer1, "%d", fd[0]);
argv[0] = buffer1;
- sprintf(buffer2, "%d", filedes[1]);
+ sprintf(buffer2, "%d", fd[1]);
argv[1] = buffer2;
argv[2] = NULL;
/* Start redirect_reader thread */
- printf("redirection_test: Starting redirect_reader task with fd=%d\n", filedes[0]);
+ printf("redirection_test: Starting redirect_reader task with fd=%d\n", fd[0]);
readerid = task_create("redirect_reader", 50, CONFIG_EXAMPLES_PIPE_STACKSIZE, redirect_reader, argv);
if (readerid < 0)
{
@@ -284,7 +284,7 @@ int redirection_test(void)
/* Start redirect_writer task */
- printf("redirection_test: Starting redirect_writer task with fd=%d\n", filedes[1]);
+ printf("redirection_test: Starting redirect_writer task with fd=%d\n", fd[1]);
writerid = task_create("redirect_writer", 50, CONFIG_EXAMPLES_PIPE_STACKSIZE, redirect_writer, argv);
if (writerid < 0)
{
@@ -299,11 +299,11 @@ int redirection_test(void)
/* We should be able to close the pipe file descriptors now. */
- if (close(filedes[0]) != 0)
+ if (close(fd[0]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
diff --git a/apps/system/readline/readline.c b/apps/system/readline/readline.c
index 1fb30e840..5486a68eb 100644
--- a/apps/system/readline/readline.c
+++ b/apps/system/readline/readline.c
@@ -133,7 +133,7 @@ static inline int readline_rawgetc(int infd)
nread = read(infd, &buffer, 1);
/* Check for end-of-file. */
-
+
if (nread == 0)
{
/* Return EOF on end-of-file */
@@ -186,7 +186,7 @@ static inline void readline_consoleputc(int ch, int outfd)
nwritten = write(outfd, &buffer, 1);
/* Check for irrecoverable write errors. */
-
+
if (nwritten < 0 && errno != EINTR)
{
break;
@@ -264,8 +264,8 @@ ssize_t readline(FAR char *buf, int buflen, FILE *instream, FILE *outstream)
* standard)
*/
- infd = instream->fs_filedes;
- outfd = outstream->fs_filedes;
+ infd = instream->fs_fd;
+ outfd = outstream->fs_fd;
/* <esc>[K is the VT100 command that erases to the end of the line. */
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 04466e427..9e5c8122a 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i>
</font></big></h1>
- <p>Last Updated: August 13, 2013</p>
+ <p>Last Updated: September 28, 2013</p>
</td>
</tr>
</table>
@@ -2806,13 +2806,13 @@ extern void up_ledoff(int led);
Each character device driver must implement an instance of <code>struct file_operations</code>.
That structure defines a call table with the following methods:
<ul>
- <p><code>int open(FAR struct file *filp);</code><br>
- <code>int close(FAR struct file *filp);</code><br>
- <code>ssize_t read(FAR struct file *filp, FAR char *buffer, size_t buflen);</code><br>
- <code>ssize_t write(FAR struct file *filp, FAR const char *buffer, size_t buflen);</code><br>
- <code>off_t seek(FAR struct file *filp, off_t offset, int whence);</code><br>
- <code>int ioctl(FAR struct file *filp, int cmd, unsigned long arg);</code><br>
- <code>int poll(FAR struct file *filp, struct pollfd *fds, bool setup);</code></p>
+ <p><code>int open(FAR struct file *filep);</code><br>
+ <code>int close(FAR struct file *filep);</code><br>
+ <code>ssize_t read(FAR struct file *filep, FAR char *buffer, size_t buflen);</code><br>
+ <code>ssize_t write(FAR struct file *filep, FAR const char *buffer, size_t buflen);</code><br>
+ <code>off_t seek(FAR struct file *filep, off_t offset, int whence);</code><br>
+ <code>int ioctl(FAR struct file *filep, int cmd, unsigned long arg);</code><br>
+ <code>int poll(FAR struct file *filep, struct pollfd *fds, bool setup);</code></p>
</ul>
</p>
</li>
diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html
index 68df699dd..bedc07226 100644
--- a/nuttx/Documentation/NuttxUserGuide.html
+++ b/nuttx/Documentation/NuttxUserGuide.html
@@ -13,7 +13,7 @@
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt<p>
- <p>Last Updated: June 4, 2013</p>
+ <p>Last Updated: September 28, 2013</p>
</td>
</tr>
</table>
@@ -250,14 +250,14 @@ paragraphs.
<H3><a name="taskcreate">2.1.1 task_create</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<ul><pre>
#include &lt;sched.h&gt;
int task_create(char *name, int priority, int stack_size, main_t entry, char * const argv[]);
</pre></ul>
<p>
-<b>Description:</b>
+<b>Description:</b>
This function creates and activates a new task with a
specified priority and returns its system-assigned ID.
</p>
@@ -291,7 +291,7 @@ int task_create(char *name, int priority, int stack_size, main_t entry, char * c
redirection of standard I/O is supported.
</p>
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>name</code>. Name of the new task</LI>
<li><code>priority</code>. Priority of the new task</LI>
@@ -304,7 +304,7 @@ int task_create(char *name, int priority, int stack_size, main_t entry, char * c
If no parameters are required, argv may be NULL.
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
</P>
<ul>
<li>
@@ -315,7 +315,7 @@ int task_create(char *name, int priority, int stack_size, main_t entry, char * c
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following similar interface:
@@ -339,7 +339,7 @@ VxWorks provides the following similar interface:
<H3><a name="taskinit">2.1.2 task_init</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int task_init(struct tcb_s *tcb, char *name, int priority, uint32_t *stack, uint32_t stack_size,
@@ -358,7 +358,7 @@ VxWorks provides the following similar interface:
This must be done by calling task_activate().
</P>
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>tcb</code>. Address of the new task's TCB
<li><code>name</code>. Name of the new task (not used)
@@ -374,7 +374,7 @@ VxWorks provides the following similar interface:
</ul>
</p>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
</p>
<ul>
<li><p>OK, or ERROR if the task cannot be initialized.</P>
@@ -411,7 +411,7 @@ VxWorks provides the following similar interface:
<H3><a name="taskactivate">2.1.3 task_activate</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int task_activate(struct tcb_s *tcb);
@@ -422,14 +422,14 @@ VxWorks provides the following similar interface:
Without activation, a task is ineligible for execution by the
scheduler.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>tcb</code>. The TCB for the task for the task (same as the
task_init argument).
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK, or ERROR if the task cannot be activated (<a href="#ErrnoAccess"><code>errno</code></a> is not set).
</ul>
@@ -461,7 +461,7 @@ the pointer to the WIND_TCB cast to an integer.
<H3><a name="taskdelete">2.1.4 task_delete</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<ul><pre>
#include &lt;sched.h&gt;
int task_delete(pid_t pid);
@@ -472,7 +472,7 @@ int task_delete(pid_t pid);
This function causes a specified task to cease to exist -- its stack and TCB will be deallocated.
This function is the companion to task_create().
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li>
<code>pid</code>.
@@ -481,7 +481,7 @@ int task_delete(pid_t pid);
Any attempt by the calling task will be automatically re-directed to <code>exit()</code>.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>
<code>OK</code>, or <code>ERROR</code> if the task cannot be deleted.
@@ -489,7 +489,7 @@ int task_delete(pid_t pid);
</li>
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<code>task_delete()</code> must be used with caution:
If the task holds resources (for example, allocated memory or semaphores needed by other tasks), then <code>task_delete()</code> can strand those resources.
@@ -544,14 +544,14 @@ int task_restart(pid_t pid);
</li>
</ol>
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>pid</code>.
The task ID of the task to delete.
An ID of zero would signify the calling task (However, support for a task to restart itself has not been implemented).
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>
OK, or ERROR if the task ID is invalid or the task could
@@ -562,7 +562,7 @@ int task_restart(pid_t pid);
</li>
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following similar interface:
@@ -586,7 +586,7 @@ VxWorks provides the following similar interface:
<H3><a name="exit">2.1.6 exit</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
void exit(int code);
@@ -601,7 +601,7 @@ to exist -- its stack and TCB will be deallocated. exit differs from
_exit in that it flushes streams, closes file descriptors and will
execute any function registered with <code>atexit()</code> or <code>on_exit()</code>.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>code</code>. (ignored)
</ul>
@@ -610,7 +610,7 @@ execute any function registered with <code>atexit()</code> or <code>on_exit()</c
<b>Returned Value:</b> None.
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is equivalent to the ANSI interface:
@@ -632,7 +632,7 @@ And the UNIX interface:
<H3><a name="getpid">2.1.7 getpid</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;unistd.h&gt;
pid_t getpid(void);
@@ -645,13 +645,13 @@ level.
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>The task ID of the calling task.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b>
Compatible with the POSIX interface of the same name.
@@ -667,7 +667,7 @@ pid_t vfork(void);
</pre></ul>
<p>
<b>Description:</b>
- The <code>vfork()</code> function has the same effect as <code>fork()</code>, except that the behavior is undefined if the process created by <code>vfork()</code> either modifies any data other than a variable of type <code>pid_t</code> used to store the return value from <code>vfork()</code>, or returns from the function in which <code>vfork()</code> was called, or calls any other function before successfully calling <code>_exit()</code> or one of the <code>exec</code> family of functions.
+ The <code>vfork()</code> function has the same effect as <code>fork()</code>, except that the behavior is undefined if the process created by <code>vfork()</code> either modifies any data other than a variable of type <code>pid_t</code> used to store the return value from <code>vfork()</code>, or returns from the function in which <code>vfork()</code> was called, or calls any other function before successfully calling <code>_exit()</code> or one of the <code>exec</code> family of functions.
<p>
<blockquote><small>
<b>NOTE:</b>
@@ -679,12 +679,12 @@ pid_t vfork(void);
None.
</p>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
Upon successful completion, <code>vfork()</code> returns 0 to the child process and returns
the process ID of the child process to the parent process.
- Otherwise, -1 is returned to the parent, no child process is created, and <code>errno</code> is set to indicate the error.
+ Otherwise, -1 is returned to the parent, no child process is created, and <code>errno</code> is set to indicate the error.
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -765,11 +765,11 @@ int execv(FAR const char *path, FAR char *const argv[]);
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
This function does not return on success.
- On failure, it will return -1 (<code>ERROR</code>) and will set the <code>errno</code> value appropriately.
+ On failure, it will return -1 (<code>ERROR</code>) and will set the <code>errno</code> value appropriately.
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -804,16 +804,16 @@ int execl(FAR const char *path, ...);
<li>
</li>
<code>...</code>:
- A list of the string arguments to be recevied by the program.
+ A list of the string arguments to be recevied by the program.
Zero indicates the end of the list.
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
This function does not return on success.
- On failure, it will return -1 (<code>ERROR</code>) and will set the <code>errno</code> value appropriately.
+ On failure, it will return -1 (<code>ERROR</code>) and will set the <code>errno</code> value appropriately.
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -924,7 +924,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
<code>posix_spawn()</code> and <code>posix_spawnp()</code> will return zero on success.
Otherwise, an error number will be returned as the function return value to indicate the error:
</p>
@@ -938,7 +938,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<ul>
<li>
@@ -1013,7 +1013,7 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
<p>
@@ -1044,7 +1044,7 @@ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actio
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1081,7 +1081,7 @@ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_action
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1126,7 +1126,7 @@ int posix_spawn_file_actions_addopen(FAR posix_spawn_file_actions_t *file_action
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1162,7 +1162,7 @@ int posix_spawnattr_init(FAR posix_spawnattr_t *attr);
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1192,7 +1192,7 @@ int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr, FAR short *flags
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1222,7 +1222,7 @@ int posix_spawnattr_getschedparam(FAR const posix_spawnattr_t *attr, FAR struct
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1252,7 +1252,7 @@ int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr, FAR int *p
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1284,7 +1284,7 @@ int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr, FAR sigset_t *
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1314,7 +1314,7 @@ int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags);
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1347,7 +1347,7 @@ int posix_spawnattr_setschedparam(FAR posix_spawnattr_t *attr, FAR const struct
<b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
-
+
<h3><a name="posix_spawnattr_setschedpolicy">2.1.24 posix_spawnattr_setschedpolicy</a></h3>
<p>
<b>Function Prototype:</b>
@@ -1406,7 +1406,7 @@ int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr, FAR const sigset_t *
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1515,7 +1515,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
<code>task_spawn()</code> will return zero on success.
Otherwise, an error number will be returned as the function return value to indicate the error:
</p>
@@ -1550,7 +1550,7 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, FAR size_t *s
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, this function returns 0; on failure it will return an error number from <code>&lt;errno.h&gt;</code>
</p>
@@ -1712,7 +1712,7 @@ int posix_spawn_file_actions_init(FAR posix_spawn_file_actions_t *file_actions);
<H3><a name="schedgetparam">2.2.2 sched_getparam</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_getparam (pid_t pid, struct sched_param *param);
@@ -1722,7 +1722,7 @@ int posix_spawn_file_actions_init(FAR posix_spawn_file_actions_t *file_actions);
<b>Description:</b> This function gets the scheduling priority
of the task specified by pid.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li>
<code>pid</code>. The task ID of the task.
@@ -1736,20 +1736,20 @@ of the task specified by pid.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) if successful, otherwise -1 (<code>ERROR</code>).
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
<H3><a name="schedsetscheduler">2.2.3 sched_setscheduler</a></H3>
<p>
- <b>Function Prototype:</b>
+ <b>Function Prototype:</b>
</p>
<ul><pre>
#include &lt;sched.h&gt;
@@ -1762,7 +1762,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
The parameter <code>param</code> holds the priority of the thread under the new policy.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li>
@@ -1781,7 +1781,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, <code>sched_setscheduler()</code> returns <code>OK</code> (zero). On
error, <code>ERROR</code> (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set appropriately:
</p>
@@ -1798,7 +1798,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
<H3><a name="setgetscheduler">2.2.4 sched_getscheduler</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<ul><pre>
#include &lt;sched.h&gt;
int sched_getscheduler (pid_t pid);
@@ -1810,7 +1810,7 @@ int sched_getscheduler (pid_t pid);
<code>pid</code> equals zero, the policy of the calling process will
be retrieved.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>pid</code>.
The task ID of the task to query.
@@ -1818,7 +1818,7 @@ int sched_getscheduler (pid_t pid);
</LI>
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>
On success, <code>sched_getscheduler()</code> returns the policy for
@@ -1830,14 +1830,14 @@ int sched_getscheduler (pid_t pid);
</li>
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX interface of the same name.
<H3><a name="sched_yield">2.2.5 sched_yield</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_yield(void);
@@ -1849,13 +1849,13 @@ up the CPU (only to other tasks at the same priority).
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) or -1 (<code>ERROR</code>)
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -1863,7 +1863,7 @@ interface of the same name.
<H3><a name="schedgetprioritymax">2.2.6 sched_get_priority_max</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_get_priority_max (int policy)
@@ -1873,19 +1873,19 @@ interface of the same name.
<b>Description:</b> This function returns the value of the highest
possible task priority for a specified scheduling policy.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>policy</code>. Scheduling policy requested.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>The maximum priority value or -1 (<code>ERROR</code>).
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -1893,7 +1893,7 @@ interface of the same name.
<H3><a name="schedgetprioritymin">2.2.7 sched_get_priority_min</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_get_priority_min (int policy);
@@ -1903,19 +1903,19 @@ interface of the same name.
<b>Description:</b> This function returns the value of the lowest
possible task priority for a specified scheduling policy.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>policy</code>. Scheduling policy requested.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>The minimum priority value or -1 (<code>ERROR</code>)
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -1923,14 +1923,14 @@ interface of the same name.
<H3><a name="schedgetrrinterval">2.2.8 sched_get_rr_interval</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_get_rr_interval (pid_t pid, struct timespec *interval);
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
<code>sched_rr_get_interval()</code> writes the timeslice interval
for task identified by <code>pid</code> into the timespec structure
pointed to by <code>interval</code>. If pid is zero, the timeslice
@@ -1939,7 +1939,7 @@ interface of the same name.
scheduling policy.'
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>pid</code>. The task ID of the task. If pid is zero, the
@@ -1948,7 +1948,7 @@ priority of the calling task is returned.
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, sched_rr_get_interval() returns OK (0). On
error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set to:
</p>
@@ -1960,7 +1960,7 @@ priority of the calling task is returned.
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -2100,7 +2100,7 @@ int ret = sigaction(SIGCHLD, &sa, NULL);
<H3><a name="schedlock">2.3.1 sched_lock</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_lock(void);
@@ -2115,13 +2115,13 @@ number of times) or until it blocks itself.
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK or ERROR.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the comparable interface:
@@ -2132,7 +2132,7 @@ VxWorks provides the comparable interface:
<H3><a name="schedunlock">2.3.2 sched_unlock</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int sched_unlock(void);
@@ -2148,13 +2148,13 @@ eligible to preempt the current task will execute.
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK or ERROR.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the comparable interface:
@@ -2165,7 +2165,7 @@ VxWorks provides the comparable interface:
<H3><a name="schedlockcount">2.3.3 sched_lockcount</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
int32_t sched_lockcount(void)
@@ -2179,13 +2179,13 @@ on this thread of execution.
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>The current value of the lockCount.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> None.
</p>
@@ -2193,14 +2193,14 @@ on this thread of execution.
<H3><a name="waitpid">2.3.4 waitpid</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sys/wait.h&gt;
ipid_t waitpid(pid_t pid, int *stat_loc, int options);
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
</p>
<blockquote><small>
The following discussion is a general description of the <code>waitpid()</code> interface.
@@ -2223,7 +2223,7 @@ on this thread of execution.
Because <code>waitpid()</code> is not fully POSIX compliant, it must be specifically enabled by setting <code>CONFIG_SCHED_WAITPID</code> in the NuttX configuration file.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>pid</code>. The task ID of the thread to waid for</li>
@@ -2256,19 +2256,19 @@ on this thread of execution.
<ul>
<li>
<code>WCONTINUED</code>.
- The <code>waitpid()</code> function will report the status of any continued child process specified by pid whose status has not been reported since it continued from a job control stop.
+ The <code>waitpid()</code> function will report the status of any continued child process specified by pid whose status has not been reported since it continued from a job control stop.
</li>
<li>
<code>WNOHANG</code>.
- The <code>waitpid()</code> function will not suspend execution of the calling thread if status is not immediately available for one of the child processes specified by <code>pid</code>.
+ The <code>waitpid()</code> function will not suspend execution of the calling thread if status is not immediately available for one of the child processes specified by <code>pid</code>.
</li>
<li>
<code>WUNTRACED</code>.
- The status of any child processes specified by <code>pid</code> that are stopped, and whose status has not yet been reported since they stopped, will also be reported to the requesting process.
+ The status of any child processes specified by <code>pid</code> that are stopped, and whose status has not yet been reported since they stopped, will also be reported to the requesting process.
</li>
</ul>
<p>
- If the calling process has <code>SA_NOCLDWAIT</code> set or has <code>SIGCHLD</code> set to <code>SIG_IGN</code>, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread will block until all of the children of the process containing the calling thread terminate, and <code>waitpid()</code> will fail and set <code>errno</code> to <code>ECHILD</code>.
+ If the calling process has <code>SA_NOCLDWAIT</code> set or has <code>SIGCHLD</code> set to <code>SIG_IGN</code>, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread will block until all of the children of the process containing the calling thread terminate, and <code>waitpid()</code> will fail and set <code>errno</code> to <code>ECHILD</code>.
</p>
<p>
If <code>waitpid()</code> returns because the status of a child process is available, these functions will return a value equal to the process ID of the child process.
@@ -2296,23 +2296,23 @@ on this thread of execution.
</li>
<li>
<code>WEXITSTATUS(stat_val)</code>.
- If the value of <code>WIFEXITED(stat_val)</code> is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to <code>_exit()</code> or <code>exit()</code>, or the value the child process returned from <code>main()</code>.
+ If the value of <code>WIFEXITED(stat_val)</code> is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to <code>_exit()</code> or <code>exit()</code>, or the value the child process returned from <code>main()</code>.
</li>
<li>
<code>WIFSIGNALED(stat_val)</code>.
- Evaluates to a non-zero value if status was returned for a child process that terminated due to the receipt of a signal that was not caught (see &gt;signal.h&lt;).
+ Evaluates to a non-zero value if status was returned for a child process that terminated due to the receipt of a signal that was not caught (see &gt;signal.h&lt;).
</li>
<li>
<code>WTERMSIG(stat_val)</code>.
- If the value of <code>WIFSIGNALED(stat_val)</code> is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
+ If the value of <code>WIFSIGNALED(stat_val)</code> is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
</li>
<li>
<code>WIFSTOPPED(stat_val)</code>.
- Evaluates to a non-zero value if status was returned for a child process that is currently stopped.
+ Evaluates to a non-zero value if status was returned for a child process that is currently stopped.
</li>
<li>
<code>WSTOPSIG(stat_val)</code>.
- If the value of <code>WIFSTOPPED(stat_val)</code> is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
+ If the value of <code>WIFSTOPPED(stat_val)</code> is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
</li>
<li>
<code>WIFCONTINUED(stat_val)</code>.
@@ -2320,7 +2320,7 @@ on this thread of execution.
</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
</p>
<p>
If <code>waitpid()</code> returns because the status of a child process is available, it will return a value equal to the process ID of the child process for which status is reported.
@@ -2337,21 +2337,21 @@ on this thread of execution.
<ul>
<li>
<code>ECHILD</code>.
- The process specified by <code>pid</code> does not exist or is not a child of the calling process, or the process group specified by <code>pid</code> does not exist or does not have any member process that is a child of the calling process.
+ The process specified by <code>pid</code> does not exist or is not a child of the calling process, or the process group specified by <code>pid</code> does not exist or does not have any member process that is a child of the calling process.
</li>
<li>
<code>EINTR</code>.
The function was interrupted by a signal.
- The value of the location pointed to by <code>stat_loc</code> is undefined.
+ The value of the location pointed to by <code>stat_loc</code> is undefined.
</li>
<li>
<code>EINVAL</code>.
- The <code>options</code> argument is not valid.
+ The <code>options</code> argument is not valid.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b>
Comparable to the POSIX interface of the same name, but the implementation is incomplete (as detailed above).
@@ -2359,7 +2359,7 @@ on this thread of execution.
<h3><a name="waitid">2.3.5 waitid</a></li></h3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sys/wait.h&gt;
#ifdef CONFIG_SCHED_HAVE_PARENT
@@ -2406,25 +2406,25 @@ on this thread of execution.
<ul>
<li>
<code>WEXITED</code>:
- Wait for processes that have exited.
+ Wait for processes that have exited.
</li>
<li>
<code>WSTOPPED</code>:
- Status will be returned for any child that has stopped upon receipt of a signal.
+ Status will be returned for any child that has stopped upon receipt of a signal.
</li>
<li>
<code>WCONTINUES</code>:
- Status will be returned for any child that was stopped and has been continued.
+ Status will be returned for any child that was stopped and has been continued.
</li>
<li>
<code>WNOHANG</code>:
- Return immediately if there are no children to wait for.
+ Return immediately if there are no children to wait for.
</li>
<li>
<code>WNOWAIT</code>:
Keep the process whose status is returned in <code>info</code> in a waitable state.
This will not affect the state of the process;
- the process may be waited for again after this call completes.
+ the process may be waited for again after this call completes.
</li>
</ul>
The <code>info</code> argument must point to a <code>siginfo_t</code> structure.
@@ -2436,9 +2436,9 @@ on this thread of execution.
See the description above.
</p>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
If <code>waitid()</code> returns due to the change of state of one of its children, 0 is returned.
- Otherwise, -1 is returned and <code>errno</code> is set to indicate the error.
+ Otherwise, -1 is returned and <code>errno</code> is set to indicate the error.
</p>
<p>
The <code>waitid()</code> function will fail if:
@@ -2447,18 +2447,18 @@ on this thread of execution.
<li>
<code>ECHILD</code>:
</li>
- The calling process has no existing unwaited-for child processes.
+ The calling process has no existing unwaited-for child processes.
<li>
<code>EINTR</code>:
</li>
- The <code>waitid()</code> function was interrupted by a signal.
+ The <code>waitid()</code> function was interrupted by a signal.
<li>
<code>EINVAL</code>:
An invalid value was specified for <code>options</code>, or <code>idtype</code> and <code>id</code> specify an invalid set of processes.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b>
Comparable to the POSIX interface of the same name, but the implementation is incomplete (as detailed in the description above).
@@ -2466,7 +2466,7 @@ on this thread of execution.
<h3><a name="wait">2.3.6 wait</a></li></h3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sys/wait.h&gt;
#ifdef CONFIG_SCHED_HAVE_PARENT
@@ -2474,7 +2474,7 @@ on this thread of execution.
#endif
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
</p>
<blockquote><small>
The following discussion is a general description of the <code>wait()</code> interface.
@@ -2492,17 +2492,17 @@ on this thread of execution.
Otherwise, its behavior will be modified by the values of the <code>pid</code> and <code>options</code> arguments.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>stat_loc</code>. The location to return the exit status</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
See the values returned by <a href="#waitpid"><code>waitpaid()</code></a>.
</p>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b>
Comparable to the POSIX interface of the same name, but the implementation is incomplete (as detailed in the description <a href="#waitpid"><code>waitpaid()</code></a>).
@@ -2511,13 +2511,13 @@ on this thread of execution.
<h3><a name="atexit">2.3.7 atexit</a></h3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;stdlib.h&gt;
int atexit(void (*func)(void));
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
Registers a function to be called at program exit.
The <code>atexit()</code> function registers the given function to be called at normal process termination, whether via <code>exit()</code> or via return from the program's <code>main()</code>.
</p>
@@ -2525,19 +2525,19 @@ on this thread of execution.
<b>NOTE</b>: <code>CONFIG_SCHED_ATEXIT</code> must be defined to enable this function.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>func</code>. A pointer to the function to be called when the task exits.</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, <code>atexit()</code> returns OK (0).
On error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set to indicate the cause of the failure.
</p>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the ISO C interface of the same name.
Limitiations in the current implementation:
@@ -2550,13 +2550,13 @@ on this thread of execution.
<H3><a name="onexit">2.3.8 on_exit</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;stdlib.h&gt;
int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg)
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
Registers a function to be called at program exit.
The <code>on_exit()</code> function registers the given function to be called at normal process termination, whether via <code>exit()</code> or via return from the program's <code>main()</code>.
The function is passed the status argument given to the last call to <code>exit()</code> and the <code>arg</code> argument from <code>on_exit()</code>.
@@ -2565,25 +2565,25 @@ on this thread of execution.
<b>NOTE</b>: <code>CONFIG_SCHED_ONEXIT</code> must be defined to enable this function
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>func</code>. A pointer to the function to be called when the task exits.</li>
<li><code>arg</code>. An argument that will be provided to the <code>on_exit()</code> function when the task exits.</li>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
On success, <code>on_exit()</code> returns OK (0).
On error, ERROR (-1) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> is set to indicate the cause of the failure.
</p>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b>
This function comes from SunOS 4, but is also present in libc4, libc5 and glibc.
It no longer occurs in Solaris (SunOS 5).
- Avoid this function, and use the standard <code>atexit()</code> instead.
+ Avoid this function, and use the standard <code>atexit()</code> instead.
</p>
<ol>
<li>Only a single <code>on_exit</code> function can be registered unless <code>CONFIG_SCHED_ONEXIT_MAX</code> defines a larger number.</li>
@@ -2619,7 +2619,7 @@ on this thread of execution.
<H3><a name="mqopen">2.4.1 mq_open</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
mqd_t mq_open(const char *mqName, int oflags, ...);
@@ -2632,7 +2632,7 @@ call of mq_open(), the task can reference the message queue using
the address returned by the call. The message queue remains usable
until it is closed by a successful call to mq_close().
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>mqName</code>. Name of the queue to open
<li><code>oflags</code>. Open flags. These may be any combination of:
@@ -2668,13 +2668,13 @@ message that can be sent or received. Other elements of attr are ignored
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>A message queue descriptor or -1 (<code>ERROR</code>)
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX interface
of the same name.
@@ -2688,7 +2688,7 @@ message size is limited at 22 bytes.
<H3><a name="mqclose">2.4.2 mq_close</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
int mq_close(mqd_t mqdes);
@@ -2705,20 +2705,20 @@ queue via this <code>mqdes</code> (see <code>mq_notify()</code>), this attachmen
removed and the message queue is available for another task to attach
for notification.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>mqdes</code>. Message queue descriptor.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) if the message queue is closed successfully, otherwise,
-1 (<code>ERROR</code>).
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<ul>
<li>
@@ -2735,7 +2735,7 @@ of the same name.
<H3><a name="mqunlink">2.4.3 mq_unlink</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
int mq_unlink(const char *mqName);
@@ -2748,7 +2748,7 @@ open when <code>mq_unlink()</code> is called, removal of the message queue
is postponed until all references to the message queue have been
closed.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>mqName</code>. Name of the message queue
</ul>
@@ -2756,14 +2756,14 @@ closed.
<p>
<b>Returned Value:</b> None.
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
<H3><a name="mqsend">2.4.4 mq_send</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
</p>
<pre>
#include &lt;mqueue.h&gt;
@@ -2808,7 +2808,7 @@ interface of the same name.
</li>
</ul>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>mqdes</code>. Message queue descriptor.</li>
@@ -2845,7 +2845,7 @@ interface of the same name.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -2853,7 +2853,7 @@ interface of the same name.
</p>
<h3><a name="mqtimedsend">mq_timedsend</a></h3>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
</p>
<pre>
#include &lt;mqueue.h&gt;
@@ -2891,7 +2891,7 @@ interface of the same name.
of the call, <code>mq_timedsend()</code> returns immediately.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>mqdes</code>. Message queue descriptor.</li>
@@ -2928,7 +2928,7 @@ interface of the same name.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -2937,7 +2937,7 @@ interface of the same name.
<h3><a name="mqreceive">2.4.5 mq_receive</a></h3>
<p>
- <b>Function Prototype:</b>
+ <b>Function Prototype:</b>
</p>
<pre>
#include &lt;mqueue.h&gt;
@@ -2962,7 +2962,7 @@ interface of the same name.
If the queue is empty and <code>O_NONBLOCK</code> is set, <code>ERROR</code> will be returned.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>mqdes</code>. Message Queue Descriptor.</li>
@@ -2998,7 +2998,7 @@ interface of the same name.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -3007,7 +3007,7 @@ interface of the same name.
<h3><a name="mqtimedreceive">2.4.6 mq_timedreceive</a></h3>
<p>
- <b>Function Prototype:</b>
+ <b>Function Prototype:</b>
</p>
<pre>
#include &lt;mqueue.h&gt;
@@ -3042,7 +3042,7 @@ interface of the same name.
the call, <code>mq_timedreceive()</code> returns immediately.
</p>
<p>
- <b>Input Parameters:</b>
+ <b>Input Parameters:</b>
</p>
<ul>
<li><code>mqdes</code>. Message Queue Descriptor.</li>
@@ -3083,7 +3083,7 @@ interface of the same name.
</li>
</ul>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -3093,7 +3093,7 @@ interface of the same name.
<h3><a name="mqnotify">2.4.7 mq_notify</a></h3>
<p>
- <b>Function Prototype:</b>
+ <b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
int mq_notify(mqd_t mqdes, const struct sigevent *notification);
@@ -3135,16 +3135,16 @@ interface of the same name.
<code>errno</code> set to indicate the error:
<ul>
<li>
- <code>EBADF</code>. The descriptor specified in <code>mqdes</code> is invalid.
+ <code>EBADF</code>. The descriptor specified in <code>mqdes</code> is invalid.
</li>
<li>
<code>EBUSY</code>. Another process has already registered to receive notification
- for this message queue.
+ for this message queue.
</li>
<li>
<code>EINVAL</code>. <code>sevp->sigev_notify</code> is not one of the permitted values; or
<code>sevp->sigev_notify</code> is <code>SIGEV_SIGNAL</code> and <code>sevp->sigev_signo</code> is not a
- valid signal number.
+ valid signal number.
</li>
<li>
<code>ENOMEM</code>. Insufficient memory.
@@ -3174,7 +3174,7 @@ interface of the same name.
<H3><a name="mqsetattr">2.4.8 mq_setattr</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqStat,
@@ -3190,7 +3190,7 @@ If &quot;oldMqStat&quot; is non-null, mq_setattr() will store
the previous message queue attributes at that location (just as
would have been returned by mq_getattr()).
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>mqdes</code>. Message queue descriptor
<li><code>mqStat</code>. New attributes
@@ -3198,14 +3198,14 @@ would have been returned by mq_getattr()).
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) if attributes are set successfully, otherwise -1
(<code>ERROR</code>).
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3213,7 +3213,7 @@ interface of the same name.
<H3><a name="mqgetattr">2.4.9 mq_getattr</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;mqueue.h&gt;
int mq_getattr(mqd_t mqdes, struct mq_attr *mqStat);
@@ -3223,7 +3223,7 @@ interface of the same name.
<b>Description:</b> This functions gets status information and
attributes associated with the specified message queue.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>mqdes</code>. Message queue descriptor
<li><code>mqStat</code>. Buffer in which to return attributes. The returned
@@ -3238,13 +3238,13 @@ attributes include:
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) if attributes provided, -1 (<code>ERROR</code>) otherwise.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3400,7 +3400,7 @@ interface of the same name.
<H3><a name="seminit">2.5.1 sem_init</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_init(sem_t *sem, int pshared, unsigned int value);
@@ -3417,21 +3417,21 @@ result of referring to copies of <code>sem</code> in calls to <code>sem_wait()</
<code>sem_trywait()</code>, <code>sem_post()</code>, and <code>sem_destroy()</code>, is
not defined.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore to be initialized
<li><code>pshared</code>. Process sharing (not used)
-<li><code>value</code>. Semaphore initialization value
+<li><code>value</code>. Semaphore initialization value
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3443,7 +3443,7 @@ Differences from the full POSIX implementation include:
<H3><a name="semdestroy">2.5.2 sem_destroy</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_destroy(sem_t *sem);
@@ -3460,19 +3460,19 @@ effect of subsequent use of the semaphore <code>sem</code> is undefined until
The effect of destroying a semaphore upon which other tasks are currently
blocked is undefined.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore to be destroyed.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3480,7 +3480,7 @@ interface of the same name.
<H3><a name="semopen">2.5.3 sem_open</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
sem_t *sem_open(const char *name, int oflag, ...);
@@ -3499,7 +3499,7 @@ If a task makes multiple calls to sem_open() with the same name,
then the same semaphore address is returned (provided there have
been no calls to sem_unlink()).
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>name</code>. Semaphore name
<li><code>oflag</code>. Semaphore creation options. This may one of
@@ -3516,7 +3516,7 @@ a new semaphore unless one of this name already exists.
NOTE: When the O_CREAT flag is specified, POSIX requires that a third
and fourth parameter be supplied:
<ul>
-<li><code>mode</code>. The mode parameter is of type mode_t.
+<li><code>mode</code>. The mode parameter is of type mode_t.
This parameter is required but not used in the present
implementation.
<li><code>value</code>. The value parameter is type unsigned int. The semaphore
@@ -3527,13 +3527,13 @@ semaphores must be less than or equal to <code>SEM_VALUE_MAX</code> (defined in
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>A pointer to sem_t or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3546,7 +3546,7 @@ just a counting semaphore.
<H3><a name="semclose">2.5.4 sem_close</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_close(sem_t *sem);
@@ -3566,13 +3566,13 @@ will vanish when the last task closes it.
Care must be taken to avoid risking the deletion of a semaphore
that another calling task has already locked.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore descriptor
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
@@ -3591,7 +3591,7 @@ interface of the same name.
<H3><a name="semunlink">2.5.5 sem_unlink</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_unlink(const char *name);
@@ -3604,19 +3604,19 @@ name open when sem_unlink() is called, destruction of the semaphore will
be postponed until all references have been destroyed by calls to
sem_close().
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>name</code>. Semaphore name
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<ul>
<li>Care must be taken to avoid deletion of a semaphore that another task
has already locked.
@@ -3637,7 +3637,7 @@ same name should be created after sem_unlink() is called.
<H3><a name="semwait">2.5.6 sem_wait</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_wait(sem_t *sem);
@@ -3649,13 +3649,13 @@ referenced by sem. If the semaphore as already locked by another
task, the calling task will not return until it either successfully acquires
the lock or the call is interrupted by a signal.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore descriptor.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) is unsuccessful
</ul>
@@ -3671,7 +3671,7 @@ not valid.
received by this task. In this case, the semaphore has not be acquired.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3679,7 +3679,7 @@ interface of the same name.
<H3><a name="semtimedwait">2.5.7 sem_timedwait</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
#include &lt;time.h&gt;
@@ -3687,7 +3687,7 @@ interface of the same name.
</pre>
<p>
-<b>Description:</b>
+<b>Description:</b>
This function will lock the semaphore referenced by sem as in the <code>sem_wait()</code> function.
However, if the semaphore cannot be locked without waiting for another process or thread to unlock the semaphore by performing a <code>sem_post()</code> function, this wait will be terminated when the specified timeout expires.
</p>
@@ -3695,7 +3695,7 @@ interface of the same name.
This function attempts to lock the semaphore referenced by <code>sem</code>.
If the semaphore as already locked by another task, the calling task will not return until it either successfully acquires the lock or the call is interrupted by a signal.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li>
<code>sem</code>. Semaphore descriptor.
@@ -3706,7 +3706,7 @@ interface of the same name.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) is unsuccessful
</ul>
@@ -3748,7 +3748,7 @@ The following lists the possible values for <a href="#ErrnoAccess"><code>errno</
<H3><a name="semtrywait">2.5.8 sem_trywait</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_trywait(sem_t *sem);
@@ -3759,13 +3759,13 @@ The following lists the possible values for <a href="#ErrnoAccess"><code>errno</
only if the semaphore is currently not locked. In any event, the call
returns without blocking.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. The semaphore descriptor
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) or -1 (<code>ERROR</code>) if unsuccessful
</ul>
@@ -3781,7 +3781,7 @@ not valid.
<p>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3789,7 +3789,7 @@ interface of the same name.
<H3><a name="sempost">2.5.9 sem_post</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_post(sem_t *sem);
@@ -3810,13 +3810,13 @@ return successfully from its call to <code>sem_wait()</code>.
<p>
<b>NOTE</b>: <code>sem_post()</code> may be called from an interrupt handler.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore descriptor
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
@@ -3832,7 +3832,7 @@ interface of the same name.
<H3><a name="semgetvalue">2.5.10 sem_getvalue</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;semaphore.h&gt;
int sem_getvalue(sem_t *sem, int *sval);
@@ -3850,20 +3850,20 @@ If sem is locked, the value return by sem_getvalue() will either
be zero or a negative number whose absolute value represents the
number of tasks waiting for the semaphore.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sem</code>. Semaphore descriptor
<li><code>sval</code>. Buffer by which the value is returned
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) or -1 (<code>ERROR</code>) if unsuccessful.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -3897,7 +3897,7 @@ interface of the same name.
<H3><a name="wdcreate">2.6.1 wd_create</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
WDOG_ID wd_create(void);
@@ -3909,7 +3909,7 @@ by allocating the appropriate resources for the watchdog.
<p>
<b>Input Parameters:</b> None.
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>Pointer to watchdog that may be used as a handle in subsequent
NuttX calls (i.e., the watchdog ID), or NULL if insufficient resources
@@ -3917,7 +3917,7 @@ are available to create the watchdogs.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
@@ -3935,7 +3935,7 @@ initialization time).
<H3><a name="wddelete">2.6.2 wd_delete</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
int wd_delete(WDOG_ID wdog);
@@ -3946,14 +3946,14 @@ initialization time).
watchdog. The watchdog will be removed from the timer queue if
has been started.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>wdog</code>. The watchdog ID to delete. This is actually a
pointer to a watchdog structure.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK or ERROR
</ul>
@@ -3979,7 +3979,7 @@ before deallocating it (i.e., never returns ERROR).
<H3><a name="wdstart">2.6.3 wd_start</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry,
@@ -4000,7 +4000,7 @@ To replace either the timeout delay or the function to be executed,
call wd_start again with the same wdog; only the most recent
wd_start() on a given watchdog ID has any effect.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>wdog</code>. Watchdog ID
<li><code>delay</code>. Delay count in clock ticks
@@ -4010,7 +4010,7 @@ wd_start() on a given watchdog ID has any effect.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK or ERROR
</ul>
@@ -4031,12 +4031,12 @@ Differences from the VxWorks interface include:
<ul>
<li>The present implementation supports multiple parameters passed
to wdentry; VxWorks supports only a single parameter. The maximum
-number of parameters is determined by
+number of parameters is determined by
</ul>
<H3><a name="wdcancel">2.6.4 wd_cancel</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
int wd_cancel(WDOG_ID wdog);
@@ -4047,19 +4047,19 @@ number of parameters is determined by
watchdog timer. Watchdog timers may be canceled from the interrupt
level.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>wdog</code>. ID of the watchdog to cancel.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>OK or ERROR
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
@@ -4076,7 +4076,7 @@ VxWorks provides the following comparable interface:
Sint wd_gettime(WDOG_ID wdog);
</pre>
<p>
- <b>Description:</b>
+ <b>Description:</b>
This function returns the time remaining before the specified watchdog expires.
</p>
<p>
@@ -4086,7 +4086,7 @@ VxWorks provides the following comparable interface:
</ul>
</p>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
The time in system ticks remaining until the watchdog time expires. Zero
means either that wdog is not valid or that the wdog has already expired.
</p>
@@ -4483,7 +4483,7 @@ VxWorks provides the following comparable interface:
</p>
<p>
If the timer_gettime() succeeds, a value of 0 (<code>OK</code>) will be returned.
- If an error occurs, the value -1 (<code>ERROR</code>) will be returned, and
+ If an error occurs, the value -1 (<code>ERROR</code>) will be returned, and
<a href="#ErrnoAccess"><code>errno</code></a> set to indicate the error.
</p>
<ul>
@@ -4564,7 +4564,7 @@ VxWorks provides the following comparable interface:
<code>timer_getoverrun()</code> function will return the timer expiration overrun count for
the specified timer. The overrun count returned contains the number of extra
timer expirations that occurred between the time the signal was generated
- (queued) and when it was delivered or accepted, up to but not including an
+ (queued) and when it was delivered or accepted, up to but not including an
implementation-defined maximum of <code>DELAYTIMER_MAX</code>. If the number of such
extra expirations is greater than or equal to <code>DELAYTIMER_MAX</code>, then the
overrun count will be set to <code>DELAYTIMER_MAX</code>. The value returned by
@@ -4722,7 +4722,7 @@ interface of the same name.
<H3><a name="sigemptyset">2.8.1 sigemptyset</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigemptyset(sigset_t *set);
@@ -4732,19 +4732,19 @@ interface of the same name.
<b>Description:</b> This function initializes the signal set specified
by set such that all signals are excluded.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. Signal set to initialize.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if the signal set cannot be initialized.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4752,7 +4752,7 @@ interface of the same name.
<H3><a name="sigfillset">2.8.2 sigfillset</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigfillset(sigset_t *set);
@@ -4762,19 +4762,19 @@ interface of the same name.
<b>Description:</b> This function initializes the signal set specified
by set such that all signals are included.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. Signal set to initialize
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if the signal set cannot be initialized.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4782,7 +4782,7 @@ interface of the same name.
<H3><a name="sigaddset">2.8.3 sigaddset</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigaddset(sigset_t *set, int signo);
@@ -4792,20 +4792,20 @@ interface of the same name.
<b>Description:</b> This function adds the signal specified by
signo to the signal set specified by set.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. Signal set to add signal to
<li><code>signo</code>. Signal to add
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if the signal number is invalid.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4813,7 +4813,7 @@ interface of the same name.
<H3><a name="sigdelset">2.8.4 sigdelset</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigdelset(sigset_t *set, int signo);
@@ -4823,20 +4823,20 @@ interface of the same name.
<b>Description:</b> This function deletes the signal specified
by signo from the signal set specified by set.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. Signal set to delete the signal from
<li><code>signo</code>. Signal to delete
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if the signal number is invalid.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4844,7 +4844,7 @@ interface of the same name.
<H3><a name="sigismember">2.8.5 sigismember</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigismember(const sigset_t *set, int signo);
@@ -4854,14 +4854,14 @@ interface of the same name.
<b>Description:</b> This function tests whether the signal specified
by signo is a member of the set specified by set.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. Signal set to test
<li><code>signo</code>. Signal to test for
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>1 (TRUE), if the specified signal is a member of the set,
<li>0 (OK or FALSE), if it is not, or
@@ -4869,7 +4869,7 @@ by signo is a member of the set specified by set.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4877,7 +4877,7 @@ interface of the same name.
<H3><a name="sigaction">2.8.6 sigaction</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigaction(int signo, const struct sigaction *act,
@@ -4921,7 +4921,7 @@ Once an action is installed for a specific signal, it remains installed
until another action is explicitly requested by another call to
sigaction().
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>sig</code>. Signal of interest
<li><code>act</code>. Location of new handler
@@ -4929,13 +4929,13 @@ sigaction().
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if the signal number is invalid.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -4954,7 +4954,7 @@ Differences from the POSIX implementation include:
<H3><a name="sigprocmask">2.8.7 sigprocmask</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
@@ -4972,7 +4972,7 @@ those signals will be delivered before sigprocmask() returns.
<p>
If sigprocmask() fails, the signal mask of the task is not changed.
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>how</code>. How the signal mast will be changed:
<ul>
@@ -4990,13 +4990,13 @@ pointed to by the <code>set</code> input parameter.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>), or -1 (<code>ERROR</code>) if how is invalid.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5004,7 +5004,7 @@ interface of the same name.
<H3><a name="sigpending">2.8.8 sigpending</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigpending(sigset_t *set);
@@ -5022,19 +5022,19 @@ with POSIX which states: &quot;If a subsequent occurrence of a pending
signal is generated, it is implementation defined as to whether the signal
is delivered more than once.&quot;
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. The location to return the pending signal set.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>0 (<code>OK</code>) or -1 (<code>ERROR</code>)
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5042,7 +5042,7 @@ interface of the same name.
<H3><a name="sigsuspend">2.8.9 sigsuspend</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigsuspend(const sigset_t *set);
@@ -5068,13 +5068,13 @@ suspended.
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>-1 (<code>ERROR</code>) always
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5090,7 +5090,7 @@ is required in the present implementation (even if the signal is ignored).
<H3><a name="sigwaitinfo">2.8.10 sigwaitinfo</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigwaitinfo(const sigset_t *set, struct siginfo *info);
@@ -5100,21 +5100,21 @@ is required in the present implementation (even if the signal is ignored).
<b>Description:</b> This function is equivalent to sigtimedwait()
with a NULL timeout parameter. (see below).
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. The set of pending signals to wait for.
<li><code>info</code>. The returned signal values
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>Signal number that cause the wait to be terminated, otherwise
-1 (<code>ERROR</code>) is returned.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5122,7 +5122,7 @@ interface of the same name.
<H3><a name="sigtimedwait">2.8.11 sigtimedwait</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigtimedwait(const sigset_t *set, struct siginfo *info,
@@ -5148,12 +5148,12 @@ for si_code are defined in signal.h:
<li><code>SI_USER</code>. Signal sent from kill, raise, or abort
<li><code>SI_QUEUE</code>. Signal sent from sigqueue
<li><code>SI_TIMER</code>. Signal is result of timer expiration
- <li><code>SI_ASYNCIO</code>. Signal is the result of asynchronous IO completion
+ <li><code>SI_ASYNCIO</code>. Signal is the result of asynchronous IO completion
<li><code>SI_MESGQ</code>. Signal generated by arrival of a message on an empty message queue.
</ul>
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>set</code>. The set of pending signals to wait for.
<li><code>info</code>. The returned signal values
@@ -5161,14 +5161,14 @@ for si_code are defined in signal.h:
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>Signal number that cause the wait to be terminated, otherwise
-1 (<code>ERROR</code>) is returned.
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5188,7 +5188,7 @@ the unblocked signal is ignored.
<H3><a name="sigqueue">2.8.12 sigqueue</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;signal.h&gt;
int sigqueue (int tid, int signo, union sigval value);
@@ -5206,7 +5206,7 @@ POSIX which states: &quot;If a subsequent occurrence of a pending signal
is generated, it is implementation defined as to whether the signal
is delivered more than once.&quot;
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>tid</code>. ID of the task to receive signal
<li><code>signo</code>. Signal number
@@ -5214,7 +5214,7 @@ is delivered more than once.&quot;
</ul>
<p>
-<b>Returned Value:</b>
+<b>Returned Value:</b>
<ul>
<li>
On success (at least one signal was sent), zero (<code>OK</code>) is returned.
@@ -5228,7 +5228,7 @@ is delivered more than once.&quot;
</ul>
<p>
-<b>Assumptions/Limitations:</b>
+<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
interface of the same name.
@@ -5245,7 +5245,7 @@ be sent.
<H3><a name="kill">2.8.13 kill</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;signal.h&gt;
@@ -5253,7 +5253,7 @@ be sent.
</pre>
<p>
-<b>Description:</b>
+<b>Description:</b>
The kill() system call can be used to send any signal to
any task.
</p>
@@ -5266,7 +5266,7 @@ be sent.
is delivered more than once.&quot;
</p>
<p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><code>pid</code>. The id of the task to receive the signal.
The POSIX <code>kill()</code> specification encodes process group
@@ -5278,14 +5278,14 @@ be sent.
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
<ul>
<li>OK or ERROR
</ul>
</p>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -5301,29 +5301,29 @@ be sent.
<H3><a name="pause">2.8.14 pause</a></H3>
<p>
-<b>Function Prototype:</b>
+<b>Function Prototype:</b>
<pre>
#include &lt;unistd.h&gt;
int pause(void);
</pre>
<p>
-<b>Description:</b>
+<b>Description:</b>
The <code>pause()</code> function will suspend the calling thread until delivery of a non-blocked signal.
</p>
-<b>Input Parameters:</b>
+<b>Input Parameters:</b>
<ul>
<li><i>None</i>
</ul>
<p>
- <b>Returned Value:</b>
+ <b>Returned Value:</b>
Since <code>pause()</code> suspends thread execution indefinitely unless interrupted a signal, there is no successful completion return value.
A value of -1 (<code>ERROR</code> will always be returned and errno set to indicate the error (<code>EINTR</code>).
</p>
<p>
- <b>Assumptions/Limitations:</b>
+ <b>Assumptions/Limitations:</b>
</p>
<p>
<b>POSIX Compatibility:</b>
@@ -5405,7 +5405,7 @@ be sent.
<li><a href="#pthreadmutexattrgetpshared">2.9.28 pthread_mutexattr_getpshared</a></li>
<li><a href="#pthreadmutexattrsetpshared">2.9.29 pthread_mutexattr_setpshared</a></li>
<li><a href="#pthreadmutexattrgettype">2.9.30 pthread_mutexattr_gettype</a></li>
- <li><a href="#pthreadmutexattrsettype">2.9.31 pthread_mutexattr_settype</a></li>
+ <li><a href="#pthreadmutexattrsettype">2.9.31 pthread_mutexattr_settype</a></li>
<li><a href="#pthreadmutexinit">2.9.32 pthread_mutex_init</a></li>
<li><a href="#pthreadmutexdestrory">2.9.33 pthread_mutex_destroy</a></li>
<li><a href="#pthreadmutexlock">2.9.34 pthread_mutex_lock</a></li>
@@ -6004,7 +6004,7 @@ cancellation state is set to PTHREAD_CANCEL_ENABLE.</p>
<b>Input Parameters:</b>
<p>
<ul>
-<li><code>state</code>
+<li><code>state</code>
New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.<.li>
<li><code>oldstate</code>.
Location to return the previous cancellation state.
@@ -6164,7 +6164,7 @@ interface of the same name.
</pre>
<p>
<b>Description:</b>
- The <code>pthread_getschedparam()</code> functions will get the
+ The <code>pthread_getschedparam()</code> functions will get the
scheduling policy and parameters of threads.
For <code>SCHED_FIFO</code> and <code>SCHED_RR</code>, the only
required member of the <code>sched_param</code> structure is the
@@ -7321,7 +7321,7 @@ interface of the same name.
<b>Description:</b>
The <code>pthread_barrier_init()</code> function allocates any resources required to
use the barrier referenced by <code>barrier</code> and initialized the barrier with
- the attributes referenced by <code>attr</code>.
+ the attributes referenced by <code>attr</code>.
If <code>attr</code> is NULL, the default barrier attributes will be used.
The results are undefined if <code>pthread_barrier_init()</code> is called when any
thread is blocked on the barrier.
@@ -7444,7 +7444,7 @@ interface of the same name.
recent <code>pthread_barrier_init()</code> function that referenced it.
</p>
<p>
- The constant <code>PTHREAD_BARRIER_SERIAL_THREAD</code> is defined in
+ The constant <code>PTHREAD_BARRIER_SERIAL_THREAD</code> is defined in
<code>pthread.h</code> and its value must be distinct from any other value
returned by <code>pthread_barrier_wait()</code>.
</p>
@@ -7879,7 +7879,7 @@ interface of the same name.
<p>
Any user supplied data or logic can be accessed via the pseudo-file system.
- Built in support is provided for character and block
+ Built in support is provided for character and block
<a href="NuttxPortingGuide.html#DeviceDrivers">driver</a> <i>nodes</i> in the any
pseudo file system directory.
(By convention, however, all driver nodes should be in the <code>/dev</code>
@@ -7937,8 +7937,8 @@ interface of the same name.
<ul><pre>
#include &lt;unistd.h&gt;
int close(int fd);
- int dup(int fildes);
- int dup2(int fildes1, int fildes2);
+ int dup(int fd);
+ int dup2(int fd1, int fd2);
off_t lseek(int fd, off_t offset, int whence);
ssize_t read(int fd, void *buf, size_t nbytes);
int unlink(const char *path);
@@ -8103,7 +8103,7 @@ off_t lseek(int fd, off_t offset, int whence);
ssize_t read(int fd, FAR void *buf, size_t nbytes);
ssize_t write(int fd, FAR const void *buf, size_t nbytes);
-int pipe(int filedes[2]);
+int pipe(int fd[2]);
int chdir(FAR const char *path);
FAR char *getcwd(FAR char *buf, size_t size);
@@ -8224,22 +8224,22 @@ void *memmove(void *dest, const void *src, size_t count);
</p>
<ul><pre>
#include &lt;unistd.h&gt;
-int pipe(int filedes[2]);
+int pipe(int fd[2]);
</pre></ul>
<p>
<b>Description:</b>
<ul>
<p>
<code>pipe()</code> creates a pair of file descriptors, pointing to a pipe inode, and
- places them in the array pointed to by <code>filedes</code>.
- <code>filedes[0]</code> is for reading, <code>filedes[1]</code> is for writing.
+ places them in the array pointed to by <code>fd</code>.
+ <code>fd[0]</code> is for reading, <code>fd[1]</code> is for writing.
</p>
</ul>
</p>
<p>
<b>Input Parameters:</b>
<ul>
- <li><code>filedes[2]</code>. The user provided array in which to catch the pipe file descriptors.</li>
+ <li><code>fd[2]</code>. The user provided array in which to catch the pipe file descriptors.</li>
</ul>
</p>
</p>
@@ -8266,7 +8266,7 @@ int mkfifo(FAR const char *pathname, mode_t mode);
<p>
<code>mkfifo()</code> makes a FIFO device driver file with name <code>pathname</code>.
Unlike Linux, a NuttX FIFO is not a special file type but simply a device driver instance.
- <code>mode</code> specifies the FIFO's permissions (but is ignored in the current implementation).
+ <code>mode</code> specifies the FIFO's permissions (but is ignored in the current implementation).
</p>
<p>
Once the FIFO has been created by <code>mkfifo()</code>, any thread can open it for
@@ -8316,7 +8316,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
device specified by <code>pathname</code>
</p>
<p>Assumptions: The caller must assure that the block driver is not mounted and not in
- use when this function is called.
+ use when this function is called.
The result of formatting a mounted device is indeterminate (but likely not good).
</p>
</ul>
@@ -8363,7 +8363,7 @@ struct fat_format_s
NULL block driver string, bad number of FATS in <code>fmt</code>,
bad FAT size in <code>fmt</code>, bad cluster size in <code>fmt</code>
</li>
- <li><code>ENOENT</code> -
+ <li><code>ENOENT</code> -
<code>pathname</code> does not refer to anything in the file-system.
</li>
<li><code>ENOTBLK</code> -
@@ -8387,7 +8387,7 @@ struct fat_format_s
<p>
However, memory mapping of files is the mechanism used by NXFLAT, the NuttX
tiny binary format, to get files into memory in order to execute them.
- <code>mmap()</code> support is therefore required to support NXFLAT.
+ <code>mmap()</code> support is therefore required to support NXFLAT.
There are two conditions where <code>mmap()</code> can be supported:
</p>
<ol type="1">
@@ -8618,7 +8618,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags, int fd, off_
<li><code>ENOSYS</code> -
Returned if any of the unsupported <code>mmap()</code> features are attempted.
</li>
- <li><code>EBADF</code> -
+ <li><code>EBADF</code> -
<code>fd</code> is not a valid file descriptor.
</li>
<li><code>EINVAL</code> -
@@ -8862,7 +8862,7 @@ int listen(int sockfd, int backlog);
<li><code>ENOTSOCK</code>: The argument <code>sockfd</code> is not a socket.</li>
<li><code>EOPNOTSUPP</code>: The socket is not of a type that supports the listen operation.</li>
</ul>
-
+
<h3><a name="accept">2.12.5 accept</a></h3>
<p>
<b>Function Prototype:</b>
diff --git a/nuttx/arch/arm/src/c5471/c5471_watchdog.c b/nuttx/arch/arm/src/c5471/c5471_watchdog.c
index 83563def7..f9cf52244 100644
--- a/nuttx/arch/arm/src/c5471/c5471_watchdog.c
+++ b/nuttx/arch/arm/src/c5471/c5471_watchdog.c
@@ -1,7 +1,7 @@
/**************************************************************************
- * c5471/c5471_watchdog.c
+ * arch/arm/src/c5471/c5471_watchdog.c
*
- * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -100,7 +100,7 @@ static int wdt_open(struct file *filep);
static int wdt_close(struct file *filep);
static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen);
static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen);
-static int wdt_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
/**************************************************************************
* Private Data
@@ -190,7 +190,7 @@ static int wdt_setusec(uint32_t usec)
if (divisor >= 0x10000)
{
if (prescaler == MAX_PRESCALER)
- {
+ {
/* This is the max possible ~2.5 seconds. */
dbg("prescaler=0x%x too big!\n", prescaler);
@@ -289,7 +289,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen)
* Name: wdt_ioctl
**************************************************************************/
-static int wdt_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
diff --git a/nuttx/arch/arm/src/common/up_exit.c b/nuttx/arch/arm/src/common/up_exit.c
index 95a71f832..34dc3138a 100644
--- a/nuttx/arch/arm/src/common/up_exit.c
+++ b/nuttx/arch/arm/src/common/up_exit.c
@@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_io.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_io.c
index 6f0474f09..ff9ed418d 100644
--- a/nuttx/arch/arm/src/lpc2378/lpc23xx_io.c
+++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_io.c
@@ -1,101 +1,101 @@
-/***********************************************************************
- * arch/arm/src/arm/lpc2378/lpc23xx_head.S
- *
- * Copyright (C) 2010 Rommel Marcelo. All rights reserved.
- * Author: Rommel Marcelo
- *
- * This file is part of the NuttX RTOS:
- *
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ***********************************************************************/
-
-/***********************************************************************
- * Included files
- ***********************************************************************/
-
-#include "up_arch.h"
-#include <sys/types.h>
-#include "lpc23xx_scb.h"
-#include "lpc23xx_pinsel.h"
-#include "lpc23xx_uart.h"
-#include "lpc23xx_gpio.h"
-
-/***********************************************************************
- * Definitions
- ***********************************************************************/
-
-/***********************************************************************
-* Name: IO_Init()
-*
-* Descriptions: Initialize the target board before running the main()
-*
-************************************************************************/
-void IO_Init( void )
-{
- uint32_t regval;
-
- /* Reset all GPIO pins to default */
-
- pinsel_putreg(0, PINSEL0_OFFSET);
- pinsel_putreg(0, PINSEL1_OFFSET);
- pinsel_putreg(0, PINSEL2_OFFSET);
- pinsel_putreg(0, PINSEL3_OFFSET);
- pinsel_putreg(0, PINSEL4_OFFSET);
- pinsel_putreg(0, PINSEL5_OFFSET);
- pinsel_putreg(0, PINSEL6_OFFSET);
- pinsel_putreg(0, PINSEL7_OFFSET);
- pinsel_putreg(0, PINSEL8_OFFSET);
- pinsel_putreg(0, PINSEL9_OFFSET);
- pinsel_putreg(0, PINSEL10_OFFSET);
-
-/*
- regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC | );
- scb_getreg(regval, SCB_PCONP_OFFSET );
-*/
-
- /* Turn off all peripheral power */
-
- scb_putreg(0, SCB_PCONP_OFFSET );
-
- /* Turn on UART0/2 / Timer0 */
- /* regval = PCUART0 | PCUART2 | PCTIM0 | PCRTC ; */
-
- regval = PCUART0 | PCUART2 | PCTIM0 ;
- scb_putreg(regval , SCB_PCONP_OFFSET );
-
- /* Status LED P1.19 */
-
- dir_putreg8((1 << 3), FIO1DIR2_OFFSET);
-
- /* other io setup here */
-
- return;
-}
+/***********************************************************************
+ * arch/arm/src/arm/lpc2378/lpc23xx_head.S
+ *
+ * Copyright (C) 2010 Rommel Marcelo. All rights reserved.
+ * Author: Rommel Marcelo
+ *
+ * This file is part of the NuttX RTOS:
+ *
+ * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ***********************************************************************/
+
+/***********************************************************************
+ * Included files
+ ***********************************************************************/
+
+#include "up_arch.h"
+#include <sys/types.h>
+#include "lpc23xx_scb.h"
+#include "lpc23xx_pinsel.h"
+#include "lpc23xx_uart.h"
+#include "lpc23xx_gpio.h"
+
+/***********************************************************************
+ * Definitions
+ ***********************************************************************/
+
+/***********************************************************************
+* Name: IO_Init()
+*
+* Descriptions: Initialize the target board before running the main()
+*
+************************************************************************/
+void IO_Init( void )
+{
+ uint32_t regval;
+
+ /* Reset all GPIO pins to default */
+
+ pinsel_putreg(0, PINSEL0_OFFSET);
+ pinsel_putreg(0, PINSEL1_OFFSET);
+ pinsel_putreg(0, PINSEL2_OFFSET);
+ pinsel_putreg(0, PINSEL3_OFFSET);
+ pinsel_putreg(0, PINSEL4_OFFSET);
+ pinsel_putreg(0, PINSEL5_OFFSET);
+ pinsel_putreg(0, PINSEL6_OFFSET);
+ pinsel_putreg(0, PINSEL7_OFFSET);
+ pinsel_putreg(0, PINSEL8_OFFSET);
+ pinsel_putreg(0, PINSEL9_OFFSET);
+ pinsel_putreg(0, PINSEL10_OFFSET);
+
+/*
+ regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC | );
+ scb_getreg(regval, SCB_PCONP_OFFSET );
+*/
+
+ /* Turn off all peripheral power */
+
+ scb_putreg(0, SCB_PCONP_OFFSET );
+
+ /* Turn on UART0/2 / Timer0 */
+ /* regval = PCUART0 | PCUART2 | PCTIM0 | PCRTC ; */
+
+ regval = PCUART0 | PCUART2 | PCTIM0 ;
+ scb_putreg(regval , SCB_PCONP_OFFSET );
+
+ /* Status LED P1.19 */
+
+ dir_putreg8((1 << 3), FIO1DIR2_OFFSET);
+
+ /* other io setup here */
+
+ return;
+}
diff --git a/nuttx/arch/avr/src/common/up_exit.c b/nuttx/arch/avr/src/common/up_exit.c
index 93ec7c487..d2a4f85a9 100644
--- a/nuttx/arch/avr/src/common/up_exit.c
+++ b/nuttx/arch/avr/src/common/up_exit.c
@@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/hc/src/common/up_exit.c b/nuttx/arch/hc/src/common/up_exit.c
index c71bbafd1..e015cf1d5 100644
--- a/nuttx/arch/hc/src/common/up_exit.c
+++ b/nuttx/arch/hc/src/common/up_exit.c
@@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/mips/src/common/up_exit.c b/nuttx/arch/mips/src/common/up_exit.c
index 974bdc613..41fe57a6d 100644
--- a/nuttx/arch/mips/src/common/up_exit.c
+++ b/nuttx/arch/mips/src/common/up_exit.c
@@ -106,14 +106,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/rgmp/src/bridge.c b/nuttx/arch/rgmp/src/bridge.c
index 2d0944831..640e73788 100644
--- a/nuttx/arch/rgmp/src/bridge.c
+++ b/nuttx/arch/rgmp/src/bridge.c
@@ -49,16 +49,17 @@
#include <rgmp/string.h>
#include <rgmp/stdio.h>
-struct bridge {
+struct bridge
+{
struct rgmp_bridge *b;
sem_t rd_lock;
sem_t wr_lock;
};
-static ssize_t up_bridge_read(struct file *filp, char *buffer, size_t len)
+static ssize_t up_bridge_read(struct file *filep, char *buffer, size_t len)
{
ssize_t ret;
- struct bridge *b = filp->f_inode->i_private;
+ struct bridge *b = filep->f_inode->i_private;
sem_wait(&b->rd_lock);
ret = rgmp_bridge_read(b->b, buffer, len, 0);
@@ -66,10 +67,10 @@ static ssize_t up_bridge_read(struct file *filp, char *buffer, size_t len)
return ret;
}
-static ssize_t up_bridge_write(struct file *filp, const char *buffer, size_t len)
+static ssize_t up_bridge_write(struct file *filep, const char *buffer, size_t len)
{
ssize_t ret;
- struct bridge *b = filp->f_inode->i_private;
+ struct bridge *b = filep->f_inode->i_private;
sem_wait(&b->wr_lock);
ret = rgmp_bridge_write(b->b, (char *)buffer, len, 0);
@@ -77,17 +78,18 @@ static ssize_t up_bridge_write(struct file *filp, const char *buffer, size_t len
return ret;
}
-static int up_bridge_open(struct file *filp)
+static int up_bridge_open(struct file *filep)
{
return 0;
}
-static int up_bridge_close(struct file *filp)
+static int up_bridge_close(struct file *filep)
{
return 0;
}
-static const struct file_operations up_bridge_fops = {
+static const struct file_operations up_bridge_fops =
+{
.read = up_bridge_read,
.write = up_bridge_write,
.open = up_bridge_open,
@@ -127,5 +129,3 @@ err1:
err0:
return -1;
}
-
-
diff --git a/nuttx/arch/sh/src/common/up_exit.c b/nuttx/arch/sh/src/common/up_exit.c
index e454d1b64..d7de0154c 100644
--- a/nuttx/arch/sh/src/common/up_exit.c
+++ b/nuttx/arch/sh/src/common/up_exit.c
@@ -105,14 +105,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/sim/src/up_devconsole.c b/nuttx/arch/sim/src/up_devconsole.c
index bd2be0f10..07c426719 100644
--- a/nuttx/arch/sim/src/up_devconsole.c
+++ b/nuttx/arch/sim/src/up_devconsole.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * up_devconsole.c
+ * arch/sim/src/up_devconsole.c
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -78,12 +78,12 @@ static const struct file_operations devconsole_fops =
* Private Functions
****************************************************************************/
-static ssize_t devconsole_read(struct file *filp, char *buffer, size_t len)
+static ssize_t devconsole_read(struct file *filep, char *buffer, size_t len)
{
return up_hostread(buffer, len);
}
-static ssize_t devconsole_write(struct file *filp, const char *buffer, size_t len)
+static ssize_t devconsole_write(struct file *filep, const char *buffer, size_t len)
{
return up_hostwrite(buffer, len);
}
diff --git a/nuttx/arch/x86/src/common/up_exit.c b/nuttx/arch/x86/src/common/up_exit.c
index 9b0c0cbe1..424a89f4f 100644
--- a/nuttx/arch/x86/src/common/up_exit.c
+++ b/nuttx/arch/x86/src/common/up_exit.c
@@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
sdbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- sdbg(" fd=%d\n", filep->fs_filedes);
+ sdbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/z16/src/common/up_exit.c b/nuttx/arch/z16/src/common/up_exit.c
index e4c6dcf9c..6f118fe24 100644
--- a/nuttx/arch/z16/src/common/up_exit.c
+++ b/nuttx/arch/z16/src/common/up_exit.c
@@ -106,14 +106,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
lldbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- lldbg(" fd=%d\n", filep->fs_filedes);
+ lldbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/arch/z80/src/common/up_exit.c b/nuttx/arch/z80/src/common/up_exit.c
index aa578f29e..d38e4fb03 100644
--- a/nuttx/arch/z80/src/common/up_exit.c
+++ b/nuttx/arch/z80/src/common/up_exit.c
@@ -107,14 +107,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
{
struct file_struct *filep = &streamlist->sl_streams[i];
- if (filep->fs_filedes >= 0)
+ if (filep->fs_fd >= 0)
{
#if CONFIG_STDIO_BUFFER_SIZE > 0
lldbg(" fd=%d nbytes=%d\n",
- filep->fs_filedes,
+ filep->fs_fd,
filep->fs_bufpos - filep->fs_bufstart);
#else
- lldbg(" fd=%d\n", filep->fs_filedes);
+ lldbg(" fd=%d\n", filep->fs_fd);
#endif
}
}
diff --git a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c
index d12c6bdab..c03191b02 100644
--- a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c
+++ b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c
@@ -198,9 +198,9 @@ static void lcd_action(enum slcdcode_e code, uint8_t count);
static ssize_t lcd_read(FAR struct file *, FAR char *, size_t);
static ssize_t lcd_write(FAR struct file *, FAR const char *, size_t);
-static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
-static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds, bool setup);
+static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/****************************************************************************
@@ -662,14 +662,14 @@ static void lcd_action(enum slcdcode_e code, uint8_t count)
* Name: lcd_read
****************************************************************************/
-static ssize_t lcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t lcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
uint8_t row;
uint8_t column;
int nread;
/* Try to read the entire display. Notice that the seek offset
- * (filp->f_pos) is ignored. It probably should be taken into account
+ * (filep->f_pos) is ignored. It probably should be taken into account
* and also updated after each read and write.
*/
@@ -696,7 +696,7 @@ static ssize_t lcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: lcd_write
****************************************************************************/
-static ssize_t lcd_write(FAR struct file *filp, FAR const char *buffer,
+static ssize_t lcd_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
struct lcd_instream_s instream;
@@ -781,7 +781,7 @@ static ssize_t lcd_write(FAR struct file *filp, FAR const char *buffer,
* Name: lcd_ioctl
****************************************************************************/
-static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
switch (cmd)
{
@@ -851,7 +851,7 @@ static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/configs/sam4l-xplained/src/sam_slcd.c b/nuttx/configs/sam4l-xplained/src/sam_slcd.c
index 898c7e883..d8ed61bac 100644
--- a/nuttx/configs/sam4l-xplained/src/sam_slcd.c
+++ b/nuttx/configs/sam4l-xplained/src/sam_slcd.c
@@ -321,9 +321,9 @@ static void slcd_action(enum slcdcode_e code, uint8_t count);
static ssize_t slcd_read(FAR struct file *, FAR char *, size_t);
static ssize_t slcd_write(FAR struct file *, FAR const char *, size_t);
-static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
-static int slcd_poll(FAR struct file *filp, FAR struct pollfd *fds, bool setup);
+static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/****************************************************************************
@@ -856,13 +856,13 @@ static void slcd_action(enum slcdcode_e code, uint8_t count)
* Name: slcd_read
****************************************************************************/
-static ssize_t slcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t slcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
int ret = 0;
int i;
/* Try to read the entire display. Notice that the seek offset
- * (filp->f_pos) is ignored. It probably should be taken into account
+ * (filep->f_pos) is ignored. It probably should be taken into account
* and also updated after each read and write.
*/
@@ -892,7 +892,7 @@ static ssize_t slcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: slcd_write
****************************************************************************/
-static ssize_t slcd_write(FAR struct file *filp,
+static ssize_t slcd_write(FAR struct file *filep,
FAR const char *buffer, size_t len)
{
struct slcd_instream_s instream;
@@ -1006,7 +1006,7 @@ static ssize_t slcd_write(FAR struct file *filp,
* Name: slcd_poll
****************************************************************************/
-static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
switch (cmd)
{
@@ -1156,7 +1156,7 @@ static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int slcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/configs/stm32ldiscovery/src/stm32_lcd.c b/nuttx/configs/stm32ldiscovery/src/stm32_lcd.c
index c74836959..1c14bf595 100644
--- a/nuttx/configs/stm32ldiscovery/src/stm32_lcd.c
+++ b/nuttx/configs/stm32ldiscovery/src/stm32_lcd.c
@@ -323,9 +323,9 @@ static void slcd_action(enum slcdcode_e code, uint8_t count);
static ssize_t slcd_read(FAR struct file *, FAR char *, size_t);
static ssize_t slcd_write(FAR struct file *, FAR const char *, size_t);
-static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
-static int slcd_poll(FAR struct file *filp, FAR struct pollfd *fds, bool setup);
+static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/****************************************************************************
@@ -1085,13 +1085,13 @@ static void slcd_action(enum slcdcode_e code, uint8_t count)
* Name: slcd_read
****************************************************************************/
-static ssize_t slcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t slcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
int ret = 0;
int i;
/* Try to read the entire display. Notice that the seek offset
- * (filp->f_pos) is ignored. It probably should be taken into account
+ * (filep->f_pos) is ignored. It probably should be taken into account
* and also updated after each read and write.
*/
@@ -1127,7 +1127,7 @@ static ssize_t slcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: slcd_write
****************************************************************************/
-static ssize_t slcd_write(FAR struct file *filp,
+static ssize_t slcd_write(FAR struct file *filep,
FAR const char *buffer, size_t len)
{
struct slcd_instream_s instream;
@@ -1314,7 +1314,7 @@ static ssize_t slcd_write(FAR struct file *filp,
* Name: slcd_poll
****************************************************************************/
-static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
switch (cmd)
{
@@ -1457,7 +1457,7 @@ static int slcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int slcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c b/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c
index d12838b7d..9a881647e 100644
--- a/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c
+++ b/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c
@@ -207,9 +207,9 @@ static void lcd_action(enum slcdcode_e code, uint8_t count);
static ssize_t lcd_read(FAR struct file *, FAR char *, size_t);
static ssize_t lcd_write(FAR struct file *, FAR const char *, size_t);
-static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
-static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds, bool setup);
+static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/****************************************************************************
@@ -817,14 +817,14 @@ static void lcd_action(enum slcdcode_e code, uint8_t count)
* Name: lcd_read
****************************************************************************/
-static ssize_t lcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t lcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
uint8_t row;
uint8_t column;
int nread;
/* Try to read the entire display. Notice that the seek offset
- * (filp->f_pos) is ignored. It probably should be taken into account
+ * (filep->f_pos) is ignored. It probably should be taken into account
* and also updated after each read and write.
*/
@@ -851,7 +851,7 @@ static ssize_t lcd_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: lcd_write
****************************************************************************/
-static ssize_t lcd_write(FAR struct file *filp, FAR const char *buffer,
+static ssize_t lcd_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
struct lcd_instream_s instream;
@@ -936,7 +936,7 @@ static ssize_t lcd_write(FAR struct file *filp, FAR const char *buffer,
* Name: lcd_ioctl
****************************************************************************/
-static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
switch (cmd)
{
@@ -1041,7 +1041,7 @@ static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/configs/vsn/src/sif.c b/nuttx/configs/vsn/src/sif.c
index 2dacc6f69..6fa0be5a2 100644
--- a/nuttx/configs/vsn/src/sif.c
+++ b/nuttx/configs/vsn/src/sif.c
@@ -475,7 +475,7 @@ int devsif_close(FAR struct file *filep)
}
-static ssize_t devsif_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t devsif_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
sif_sem_wait();
memset(buffer, 0, len);
@@ -484,7 +484,7 @@ static ssize_t devsif_read(FAR struct file *filp, FAR char *buffer, size_t len)
}
-static ssize_t devsif_write(FAR struct file *filp, FAR const char *buffer, size_t len)
+static ssize_t devsif_write(FAR struct file *filep, FAR const char *buffer, size_t len)
{
sif_sem_wait();
printf("getpid: %d\n", getpid() );
@@ -494,7 +494,7 @@ static ssize_t devsif_write(FAR struct file *filp, FAR const char *buffer, size_
#ifndef CONFIG_DISABLE_POLL
-static int devsif_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int devsif_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup) {
diff --git a/nuttx/drivers/bch/bchdev_driver.c b/nuttx/drivers/bch/bchdev_driver.c
index 262a0af46..597710d99 100644
--- a/nuttx/drivers/bch/bchdev_driver.c
+++ b/nuttx/drivers/bch/bchdev_driver.c
@@ -68,11 +68,14 @@
* Private Function Prototypes
****************************************************************************/
-static int bch_open(FAR struct file *filp);
-static int bch_close(FAR struct file *filp);
-static ssize_t bch_read(FAR struct file *, FAR char *, size_t);
-static ssize_t bch_write(FAR struct file *, FAR const char *, size_t);
-static int bch_ioctl(FAR struct file *filp, int cmd, unsigned long arg);
+static int bch_open(FAR struct file *filep);
+static int bch_close(FAR struct file *filep);
+static ssize_t bch_read(FAR struct file *filep, FAR char *buffer,
+ size_t buflen);
+static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer,
+ size_t buflen);
+static int bch_ioctl(FAR struct file *filep, int cmd,
+ unsigned long arg);
/****************************************************************************
* Public Data
@@ -102,9 +105,9 @@ const struct file_operations bch_fops =
*
****************************************************************************/
-static int bch_open(FAR struct file *filp)
+static int bch_open(FAR struct file *filep)
{
- FAR struct inode *inode = filp->f_inode;
+ FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;
DEBUGASSERT(inode && inode->i_private);
@@ -133,9 +136,9 @@ static int bch_open(FAR struct file *filp)
*
****************************************************************************/
-static int bch_close(FAR struct file *filp)
+static int bch_close(FAR struct file *filep)
{
- FAR struct inode *inode = filp->f_inode;
+ FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;
int ret = OK;
@@ -168,9 +171,9 @@ static int bch_close(FAR struct file *filp)
* Name:bch_read
****************************************************************************/
-static ssize_t bch_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
- FAR struct inode *inode = filp->f_inode;
+ FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;
int ret;
@@ -178,10 +181,10 @@ static ssize_t bch_read(FAR struct file *filp, FAR char *buffer, size_t len)
bch = (FAR struct bchlib_s *)inode->i_private;
bchlib_semtake(bch);
- ret = bchlib_read(bch, buffer, filp->f_pos, len);
+ ret = bchlib_read(bch, buffer, filep->f_pos, len);
if (ret > 0)
{
- filp->f_pos += len;
+ filep->f_pos += len;
}
bchlib_semgive(bch);
return ret;
@@ -191,9 +194,9 @@ static ssize_t bch_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name:bch_write
****************************************************************************/
-static ssize_t bch_write(FAR struct file *filp, FAR const char *buffer, size_t len)
+static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer, size_t len)
{
- FAR struct inode *inode = filp->f_inode;
+ FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;
int ret = -EACCES;
@@ -203,10 +206,10 @@ static ssize_t bch_write(FAR struct file *filp, FAR const char *buffer, size_t l
if (!bch->readonly)
{
bchlib_semtake(bch);
- ret = bchlib_write(bch, buffer, filp->f_pos, len);
+ ret = bchlib_write(bch, buffer, filep->f_pos, len);
if (ret > 0)
{
- filp->f_pos += len;
+ filep->f_pos += len;
}
bchlib_semgive(bch);
}
@@ -221,9 +224,9 @@ static ssize_t bch_write(FAR struct file *filp, FAR const char *buffer, size_t l
*
****************************************************************************/
-static int bch_ioctl(FAR struct file *filp, int cmd, unsigned long arg)
+static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
- FAR struct inode *inode = filp->f_inode;
+ FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;
int ret = -ENOTTY;
diff --git a/nuttx/drivers/dev_null.c b/nuttx/drivers/dev_null.c
index c70370e1e..1a405d7cf 100644
--- a/nuttx/drivers/dev_null.c
+++ b/nuttx/drivers/dev_null.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/dev_null.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@
static ssize_t devnull_read(FAR struct file *, FAR char *, size_t);
static ssize_t devnull_write(FAR struct file *, FAR const char *, size_t);
#ifndef CONFIG_DISABLE_POLL
-static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
#endif
@@ -82,7 +82,7 @@ static const struct file_operations devnull_fops =
* Name: devnull_read
****************************************************************************/
-static ssize_t devnull_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
return 0; /* Return EOF */
}
@@ -91,7 +91,7 @@ static ssize_t devnull_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: devnull_write
****************************************************************************/
-static ssize_t devnull_write(FAR struct file *filp, FAR const char *buffer, size_t len)
+static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer, size_t len)
{
return len; /* Say that everything was written */
}
@@ -101,7 +101,7 @@ static ssize_t devnull_write(FAR struct file *filp, FAR const char *buffer, size
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/drivers/dev_zero.c b/nuttx/drivers/dev_zero.c
index 5435f80ea..a1374101a 100644
--- a/nuttx/drivers/dev_zero.c
+++ b/nuttx/drivers/dev_zero.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * drivers/dev_null.c
+ * drivers/dev_zero.c
*
- * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@
static ssize_t devzero_read(FAR struct file *, FAR char *, size_t);
static ssize_t devzero_write(FAR struct file *, FAR const char *, size_t);
#ifndef CONFIG_DISABLE_POLL
-static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
#endif
@@ -82,7 +82,8 @@ static const struct file_operations devzero_fops =
* Name: devzero_read
****************************************************************************/
-static ssize_t devzero_read(FAR struct file *filp, FAR char *buffer, size_t len)
+static ssize_t devzero_read(FAR struct file *filep, FAR char *buffer,
+ size_t len)
{
memset(buffer, 0, len);
return len;
@@ -92,7 +93,8 @@ static ssize_t devzero_read(FAR struct file *filp, FAR char *buffer, size_t len)
* Name: devzero_write
****************************************************************************/
-static ssize_t devzero_write(FAR struct file *filp, FAR const char *buffer, size_t len)
+static ssize_t devzero_write(FAR struct file *filep, FAR const char *buffer,
+ size_t len)
{
return len;
}
@@ -102,7 +104,7 @@ static ssize_t devzero_write(FAR struct file *filp, FAR const char *buffer, size
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds,
+static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
diff --git a/nuttx/drivers/pipes/pipe.c b/nuttx/drivers/pipes/pipe.c
index 20c160475..ce4a7dbe1 100644
--- a/nuttx/drivers/pipes/pipe.c
+++ b/nuttx/drivers/pipes/pipe.c
@@ -172,11 +172,11 @@ static int pipe_close(FAR struct file *filep)
*
* Description:
* 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.
+ * places them in the array pointed to by 'fd'. fd[0] is for reading,
+ * fd[1] is for writing.
*
* Inputs:
- * filedes[2] - The user provided array in which to catch the pipe file
+ * fd[2] - The user provided array in which to catch the pipe file
* descriptors
*
* Return:
@@ -185,7 +185,7 @@ static int pipe_close(FAR struct file *filep)
*
****************************************************************************/
-int pipe(int filedes[2])
+int pipe(int fd[2])
{
struct pipe_dev_s *dev = NULL;
char devname[16];
@@ -249,29 +249,29 @@ int pipe(int filedes[2])
}
(void)sem_post(&g_pipesem);
-
+
/* Get a write file descriptor */
- filedes[1] = open(devname, O_WRONLY);
- if (filedes[1] < 0)
+ fd[1] = open(devname, O_WRONLY);
+ if (fd[1] < 0)
{
- err = -filedes[1];
+ err = -fd[1];
goto errout_with_driver;
}
/* Get a read file descriptor */
- filedes[0] = open(devname, O_RDONLY);
- if (filedes[0] < 0)
+ fd[0] = open(devname, O_RDONLY);
+ if (fd[0] < 0)
{
- err = -filedes[0];
+ err = -fd[0];
goto errout_with_wrfd;
}
return OK;
errout_with_wrfd:
- close(filedes[1]);
+ close(fd[1]);
errout_with_driver:
unregister_driver(devname);
errout_with_dev:
diff --git a/nuttx/fs/fs_dup.c b/nuttx/fs/fs_dup.c
index 890da039b..1cb1b1674 100644
--- a/nuttx/fs/fs_dup.c
+++ b/nuttx/fs/fs_dup.c
@@ -66,7 +66,7 @@
*
****************************************************************************/
-int dup(int fildes)
+int dup(int fd)
{
int ret = OK;
@@ -74,12 +74,12 @@ int dup(int fildes)
* descriptor. */
#if CONFIG_NFILE_DESCRIPTORS > 0
- if ((unsigned int)fildes < CONFIG_NFILE_DESCRIPTORS)
+ if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS)
{
/* Its a valid file descriptor.. dup the file descriptor using any
* other file descriptor*/
- ret = file_dup(fildes, 0);
+ ret = file_dup(fd, 0);
}
else
#endif
@@ -87,11 +87,11 @@ int dup(int fildes)
/* Not a vailid file descriptor. Did we get a valid socket descriptor? */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
- if ((unsigned int)fildes < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS))
+ if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS))
{
/* Yes.. dup the socket descriptor */
- ret = net_dup(fildes, CONFIG_NFILE_DESCRIPTORS);
+ ret = net_dup(fd, CONFIG_NFILE_DESCRIPTORS);
}
else
#endif
diff --git a/nuttx/fs/fs_dup2.c b/nuttx/fs/fs_dup2.c
index 45ff2bb73..14171fe47 100644
--- a/nuttx/fs/fs_dup2.c
+++ b/nuttx/fs/fs_dup2.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_dup2.c
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -73,21 +73,21 @@
*
****************************************************************************/
-int dup2(int fildes1, int fildes2)
+int dup2(int fd1, int fd2)
{
/* Check the range of the descriptor to see if we got a file or a socket
* descriptor.
*/
- if ((unsigned int)fildes1 >= CONFIG_NFILE_DESCRIPTORS)
+ if ((unsigned int)fd1 >= CONFIG_NFILE_DESCRIPTORS)
{
/* Not a valid file descriptor. Did we get a valid socket descriptor? */
- if ((unsigned int)fildes1 < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS))
+ if ((unsigned int)fd1 < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS))
{
/* Yes.. dup the socket descriptor */
- return net_dup2(fildes1, fildes2);
+ return net_dup2(fd1, fd2);
}
else
{
@@ -101,7 +101,7 @@ int dup2(int fildes1, int fildes2)
{
/* Its a valid file descriptor.. dup the file descriptor */
- return file_dup2(fildes1, fildes2);
+ return file_dup2(fd1, fd2);
}
}
diff --git a/nuttx/fs/fs_fdopen.c b/nuttx/fs/fs_fdopen.c
index 58ea043c5..6544ee2b8 100644
--- a/nuttx/fs/fs_fdopen.c
+++ b/nuttx/fs/fs_fdopen.c
@@ -210,7 +210,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
for (i = 0 ; i < CONFIG_NFILE_STREAMS; i++)
{
stream = &slist->sl_streams[i];
- if (stream->fs_filedes < 0)
+ if (stream->fs_fd < 0)
{
/* Zero the structure */
@@ -245,7 +245,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
* file descriptor locks this stream.
*/
- stream->fs_filedes = fd;
+ stream->fs_fd = fd;
stream->fs_oflags = (uint16_t)oflags;
sem_post(&slist->sl_sem);
diff --git a/nuttx/fs/fs_filedup.c b/nuttx/fs/fs_filedup.c
index dcc229ab3..53cdc1b0a 100644
--- a/nuttx/fs/fs_filedup.c
+++ b/nuttx/fs/fs_filedup.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_filedup.c
*
- * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -77,19 +77,19 @@
*
****************************************************************************/
-int file_dup(int fildes, int minfd)
+int file_dup(int fd, int minfd)
{
FAR struct filelist *list;
- int fildes2;
+ int fd2;
/* Get the thread-specific file list */
list = sched_getfiles();
DEBUGASSERT(list);
- /* Verify that fildes is a valid, open file descriptor */
+ /* Verify that fd is a valid, open file descriptor */
- if (!DUP_ISOPEN(fildes, list))
+ if (!DUP_ISOPEN(fd, list))
{
set_errno(EBADF);
return ERROR;
@@ -97,22 +97,22 @@ int file_dup(int fildes, int minfd)
/* Increment the reference count on the contained inode */
- inode_addref(list->fl_files[fildes].f_inode);
+ inode_addref(list->fl_files[fd].f_inode);
/* Then allocate a new file descriptor for the inode */
- fildes2 = files_allocate(list->fl_files[fildes].f_inode,
- list->fl_files[fildes].f_oflags,
- list->fl_files[fildes].f_pos,
- minfd);
- if (fildes2 < 0)
+ fd2 = files_allocate(list->fl_files[fd].f_inode,
+ list->fl_files[fd].f_oflags,
+ list->fl_files[fd].f_pos,
+ minfd);
+ if (fd2 < 0)
{
set_errno(EMFILE);
- inode_release(list->fl_files[fildes].f_inode);
+ inode_release(list->fl_files[fd].f_inode);
return ERROR;
}
- return fildes2;
+ return fd2;
}
#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */
diff --git a/nuttx/fs/fs_filedup2.c b/nuttx/fs/fs_filedup2.c
index d064aa08b..7b94cb569 100644
--- a/nuttx/fs/fs_filedup2.c
+++ b/nuttx/fs/fs_filedup2.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_filedup2.c
*
- * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -75,9 +75,9 @@
****************************************************************************/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
-int file_dup2(int fildes1, int fildes2)
+int file_dup2(int fd1, int fd2)
#else
-int dup2(int fildes1, int fildes2)
+int dup2(int fd1, int fd2)
#endif
{
FAR struct filelist *list;
@@ -91,9 +91,9 @@ int dup2(int fildes1, int fildes2)
return ERROR;
}
- /* Verify that fildes is a valid, open file descriptor */
+ /* Verify that fd is a valid, open file descriptor */
- if (!DUP_ISOPEN(fildes1, list))
+ if (!DUP_ISOPEN(fd1, list))
{
set_errno(EBADF);
return ERROR;
@@ -101,20 +101,20 @@ int dup2(int fildes1, int fildes2)
/* Handle a special case */
- if (fildes1 == fildes2)
+ if (fd1 == fd2)
{
- return fildes1;
+ return fd1;
}
- /* Verify fildes2 */
+ /* Verify fd2 */
- if ((unsigned int)fildes2 >= CONFIG_NFILE_DESCRIPTORS)
+ if ((unsigned int)fd2 >= CONFIG_NFILE_DESCRIPTORS)
{
set_errno(EBADF);
return ERROR;
}
- return files_dup(&list->fl_files[fildes1], &list->fl_files[fildes2]);
+ return files_dup(&list->fl_files[fd1], &list->fl_files[fd2]);
}
#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */
diff --git a/nuttx/fs/fs_files.c b/nuttx/fs/fs_files.c
index 739947a7d..e20e0e9ef 100644
--- a/nuttx/fs/fs_files.c
+++ b/nuttx/fs/fs_files.c
@@ -344,7 +344,7 @@ int files_allocate(FAR struct inode *inode, int oflags, off_t pos, int minfd)
*
****************************************************************************/
-int files_close(int filedes)
+int files_close(int fd)
{
FAR struct filelist *list;
int ret;
@@ -356,7 +356,7 @@ int files_close(int filedes)
/* If the file was properly opened, there should be an inode assigned */
- if (filedes < 0 || filedes >= CONFIG_NFILE_DESCRIPTORS || !list->fl_files[filedes].f_inode)
+ if (fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS || !list->fl_files[fd].f_inode)
{
return -EBADF;
}
@@ -364,7 +364,7 @@ int files_close(int filedes)
/* Perform the protected close operation */
_files_semtake(list);
- ret = _files_close(&list->fl_files[filedes]);
+ ret = _files_close(&list->fl_files[fd]);
_files_semgive(list);
return ret;
}
@@ -378,20 +378,19 @@ int files_close(int filedes)
*
****************************************************************************/
-void files_release(int filedes)
+void files_release(int fd)
{
FAR struct filelist *list;
list = sched_getfiles();
DEBUGASSERT(list);
- if (filedes >=0 && filedes < CONFIG_NFILE_DESCRIPTORS)
+ if (fd >=0 && fd < CONFIG_NFILE_DESCRIPTORS)
{
_files_semtake(list);
- list->fl_files[filedes].f_oflags = 0;
- list->fl_files[filedes].f_pos = 0;
- list->fl_files[filedes].f_inode = NULL;
+ list->fl_files[fd].f_oflags = 0;
+ list->fl_files[fd].f_pos = 0;
+ list->fl_files[fd].f_inode = NULL;
_files_semgive(list);
}
}
-
diff --git a/nuttx/fs/fs_internal.h b/nuttx/fs/fs_internal.h
index 786c683dc..648f02704 100644
--- a/nuttx/fs/fs_internal.h
+++ b/nuttx/fs/fs_internal.h
@@ -119,7 +119,7 @@ extern "C" {
*
****************************************************************************/
-EXTERN void inode_semtake(void);
+void inode_semtake(void);
/****************************************************************************
* Name: inode_semgive
@@ -129,7 +129,7 @@ EXTERN void inode_semtake(void);
*
****************************************************************************/
-EXTERN void inode_semgive(void);
+void inode_semgive(void);
/****************************************************************************
* Name: inode_search
@@ -143,10 +143,10 @@ EXTERN void inode_semgive(void);
*
****************************************************************************/
-EXTERN FAR struct inode *inode_search(FAR const char **path,
- FAR struct inode **peer,
- FAR struct inode **parent,
- FAR const char **relpath);
+FAR struct inode *inode_search(FAR const char **path,
+ FAR struct inode **peer,
+ FAR struct inode **parent,
+ FAR const char **relpath);
/****************************************************************************
* Name: inode_free
@@ -156,7 +156,7 @@ EXTERN FAR struct inode *inode_search(FAR const char **path,
*
****************************************************************************/
-EXTERN void inode_free(FAR struct inode *node);
+void inode_free(FAR struct inode *node);
/****************************************************************************
* Name: inode_nextname
@@ -167,7 +167,7 @@ EXTERN void inode_free(FAR struct inode *node);
*
****************************************************************************/
-EXTERN const char *inode_nextname(FAR const char *name);
+const char *inode_nextname(FAR const char *name);
/* fs_inodereserver.c *******************************************************/
/****************************************************************************
@@ -192,7 +192,7 @@ EXTERN const char *inode_nextname(FAR const char *name);
*
****************************************************************************/
-EXTERN int inode_reserve(FAR const char *path, FAR struct inode **inode);
+int inode_reserve(FAR const char *path, FAR struct inode **inode);
/* fs_inoderemove.c *********************************************************/
/****************************************************************************
@@ -205,7 +205,7 @@ EXTERN int inode_reserve(FAR const char *path, FAR struct inode **inode);
*
****************************************************************************/
-EXTERN int inode_remove(FAR const char *path);
+int inode_remove(FAR const char *path);
/* fs_inodefind.c ***********************************************************/
/****************************************************************************
@@ -217,15 +217,15 @@ EXTERN int inode_remove(FAR const char *path);
*
****************************************************************************/
-EXTERN FAR struct inode *inode_find(FAR const char *path, const char **relpath);
+FAR struct inode *inode_find(FAR const char *path, const char **relpath);
/* fs_inodeaddref.c *********************************************************/
-EXTERN void inode_addref(FAR struct inode *inode);
+void inode_addref(FAR struct inode *inode);
/* fs_inoderelease.c ********************************************************/
-EXTERN void inode_release(FAR struct inode *inode);
+void inode_release(FAR struct inode *inode);
/* fs_foreachinode.c ********************************************************/
/****************************************************************************
@@ -244,7 +244,7 @@ EXTERN void inode_release(FAR struct inode *inode);
*
****************************************************************************/
-EXTERN int foreach_inode(foreach_inode_t handler, FAR void *arg);
+int foreach_inode(foreach_inode_t handler, FAR void *arg);
/* fs_files.c ***************************************************************/
/****************************************************************************
@@ -255,7 +255,7 @@ EXTERN int foreach_inode(foreach_inode_t handler, FAR void *arg);
*
****************************************************************************/
-EXTERN void weak_function files_initialize(void);
+void weak_function files_initialize(void);
/****************************************************************************
* Name: files_allocate
@@ -266,7 +266,7 @@ EXTERN void weak_function files_initialize(void);
*
****************************************************************************/
-EXTERN int files_allocate(FAR struct inode *inode, int oflags, off_t pos, int minfd);
+int files_allocate(FAR struct inode *inode, int oflags, off_t pos, int minfd);
/****************************************************************************
* Name: files_close
@@ -279,7 +279,7 @@ EXTERN int files_allocate(FAR struct inode *inode, int oflags, off_t pos, int m
*
****************************************************************************/
-EXTERN int files_close(int filedes);
+int files_close(int fd);
/****************************************************************************
* Name: files_release
@@ -290,7 +290,7 @@ EXTERN int files_close(int filedes);
*
****************************************************************************/
-EXTERN void files_release(int filedes);
+void files_release(int fd);
/* fs_findblockdriver.c *****************************************************/
/****************************************************************************
@@ -316,8 +316,8 @@ EXTERN void files_release(int filedes);
*
****************************************************************************/
-EXTERN int find_blockdriver(FAR const char *pathname, int mountflags,
- FAR struct inode **ppinode);
+int find_blockdriver(FAR const char *pathname, int mountflags,
+ FAR struct inode **ppinode);
#undef EXTERN
#if defined(__cplusplus)
diff --git a/nuttx/fs/fs_lseek.c b/nuttx/fs/fs_lseek.c
index d2a2a8ca7..c59461052 100644
--- a/nuttx/fs/fs_lseek.c
+++ b/nuttx/fs/fs_lseek.c
@@ -138,7 +138,7 @@ errout:
*
* Description:
* The lseek() function repositions the offset of the open file associated
- * with the file descriptor fildes to the argument 'offset' according to the
+ * with the file descriptor fd to the argument 'offset' according to the
* directive 'whence' as follows:
*
* SEEK_SET
@@ -161,12 +161,12 @@ errout:
* Return:
* The resulting offset on success. -1 on failure withi errno set properly:
*
- * EBADF fildes is not an open file descriptor.
+ * EBADF fd is not an open file descriptor.
* EINVAL whence is not one of SEEK_SET, SEEK_CUR, SEEK_END; or the
* resulting file offset would be negative, or beyond the end of a
* seekable device.
* EOVERFLOW The resulting file offset cannot be represented in an off_t.
- * ESPIPE fildes is associated with a pipe, socket, or FIFO.
+ * ESPIPE fd is associated with a pipe, socket, or FIFO.
*
****************************************************************************/
diff --git a/nuttx/include/nuttx/fs/fs.h b/nuttx/include/nuttx/fs/fs.h
index 4a883792a..f73b0b0cf 100644
--- a/nuttx/include/nuttx/fs/fs.h
+++ b/nuttx/include/nuttx/fs/fs.h
@@ -71,20 +71,20 @@ struct file_operations
{
/* The device driver open method differs from the mountpoint open method */
- int (*open)(FAR struct file *filp);
+ int (*open)(FAR struct file *filep);
/* The following methods must be identical in signature and position because
* the struct file_operations and struct mountp_operations are treated like
* unions.
*/
- int (*close)(FAR struct file *filp);
- ssize_t (*read)(FAR struct file *filp, FAR char *buffer, size_t buflen);
- ssize_t (*write)(FAR struct file *filp, FAR const char *buffer, size_t buflen);
- off_t (*seek)(FAR struct file *filp, off_t offset, int whence);
- int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg);
+ int (*close)(FAR struct file *filep);
+ ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
+ ssize_t (*write)(FAR struct file *filep, FAR const char *buffer, size_t buflen);
+ off_t (*seek)(FAR struct file *filep, off_t offset, int whence);
+ int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
- int (*poll)(FAR struct file *filp, struct pollfd *fds, bool setup);
+ int (*poll)(FAR struct file *filep, struct pollfd *fds, bool setup);
#endif
/* The two structures need not be common after this point */
@@ -139,7 +139,7 @@ struct mountpt_operations
* information to manage privileges.
*/
- int (*open)(FAR struct file *filp, FAR const char *relpath,
+ int (*open)(FAR struct file *filep, FAR const char *relpath,
int oflags, mode_t mode);
/* The following methods must be identical in signature and position because
@@ -147,11 +147,11 @@ struct mountpt_operations
* unions.
*/
- int (*close)(FAR struct file *filp);
- ssize_t (*read)(FAR struct file *filp, FAR char *buffer, size_t buflen);
- ssize_t (*write)(FAR struct file *filp, FAR const char *buffer, size_t buflen);
- off_t (*seek)(FAR struct file *filp, off_t offset, int whence);
- int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg);
+ int (*close)(FAR struct file *filep);
+ ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
+ ssize_t (*write)(FAR struct file *filep, FAR const char *buffer, size_t buflen);
+ off_t (*seek)(FAR struct file *filep, off_t offset, int whence);
+ int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
/* The two structures need not be common after this point. The following
* are extended methods needed to deal with the unique needs of mounted
@@ -160,7 +160,7 @@ struct mountpt_operations
* Additional open-file-specific mountpoint operations:
*/
- int (*sync)(FAR struct file *filp);
+ int (*sync)(FAR struct file *filep);
int (*dup)(FAR const struct file *oldp, FAR struct file *newp);
/* Directory operations */
@@ -273,7 +273,7 @@ struct filelist
#if CONFIG_NFILE_STREAMS > 0
struct file_struct
{
- int fs_filedes; /* File descriptor associated with stream */
+ int fs_fd; /* File descriptor associated with stream */
#if CONFIG_STDIO_BUFFER_SIZE > 0
sem_t fs_sem; /* For thread safety */
pid_t fs_holder; /* Holder of sem */
@@ -621,7 +621,7 @@ int lib_flushall(FAR struct streamlist *list);
ssize_t lib_sendfile(int outfd, int infd, off_t *offset, size_t count);
#endif
-/* fs/fs_read.c *************************************************************/
+/* fs/fs_fileread.c *********************************************************/
/****************************************************************************
* Name: file_read
*
@@ -636,7 +636,7 @@ ssize_t lib_sendfile(int outfd, int infd, off_t *offset, size_t count);
ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes);
#endif
-/* fs/fs_lseek.c ************************************************************/
+/* fs/fs_fileread.c *********************************************************/
/****************************************************************************
* Name: file_seek
*
diff --git a/nuttx/include/unistd.h b/nuttx/include/unistd.h
index 46eb14cdd..dd1ef3f5a 100644
--- a/nuttx/include/unistd.h
+++ b/nuttx/include/unistd.h
@@ -129,62 +129,62 @@ EXTERN int optopt; /* unrecognized option character */
/* Task Control Interfaces */
-EXTERN pid_t vfork(void);
-EXTERN pid_t getpid(void);
-EXTERN void _exit(int status) noreturn_function;
-EXTERN unsigned int sleep(unsigned int seconds);
-EXTERN int usleep(useconds_t usec);
-EXTERN int pause(void);
+pid_t vfork(void);
+pid_t getpid(void);
+void _exit(int status) noreturn_function;
+unsigned int sleep(unsigned int seconds);
+int usleep(useconds_t usec);
+int pause(void);
/* File descriptor operations */
-EXTERN int close(int fd);
-EXTERN int dup(int fd);
-EXTERN int dup2(int fd1, int fd2);
-EXTERN int fsync(int fd);
-EXTERN off_t lseek(int fd, off_t offset, int whence);
-EXTERN ssize_t read(int fd, FAR void *buf, size_t nbytes);
-EXTERN ssize_t write(int fd, FAR const void *buf, size_t nbytes);
+int close(int fd);
+int dup(int fd);
+int dup2(int fd1, int fd2);
+int fsync(int fd);
+off_t lseek(int fd, off_t offset, int whence);
+ssize_t read(int fd, FAR void *buf, size_t nbytes);
+ssize_t write(int fd, FAR const void *buf, size_t nbytes);
/* Special devices */
-EXTERN int pipe(int filedes[2]);
+int pipe(int fd[2]);
/* Working directory operations */
-EXTERN int chdir(FAR const char *path);
-EXTERN FAR char *getcwd(FAR char *buf, size_t size);
+int chdir(FAR const char *path);
+FAR char *getcwd(FAR char *buf, size_t size);
/* File path operations */
-EXTERN int unlink(FAR const char *pathname);
-EXTERN int rmdir(FAR const char *pathname);
+int unlink(FAR const char *pathname);
+int rmdir(FAR const char *pathname);
/* Execution of programs from files */
#ifdef CONFIG_LIBC_EXECFUNCS
-EXTERN int execl(FAR const char *path, ...);
-EXTERN int execv(FAR const char *path, FAR char *const argv[]);
+int execl(FAR const char *path, ...);
+int execv(FAR const char *path, FAR char *const argv[]);
/* Non-standard functions to manage symbol tables */
struct symtab_s; /* See include/nuttx/binfmt/symtab.h */
-EXTERN void exec_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols);
-EXTERN void exec_setsymtab(FAR const struct symtab_s *symtab, int nsymbols);
+void exec_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols);
+void exec_setsymtab(FAR const struct symtab_s *symtab, int nsymbols);
#endif
/* Other */
-EXTERN int getopt(int argc, FAR char *const argv[], FAR const char *optstring);
+int getopt(int argc, FAR char *const argv[], FAR const char *optstring);
/* Accessor functions intended for use only by external NXFLAT
* modules. The global variables optarg, optind, and optopt cannot
* be referenced directly from external modules.
*/
-EXTERN FAR char **getoptargp(void); /* Optional argument following option */
-EXTERN int *getopindgp(void); /* Index into argv */
-EXTERN int *getoptoptp(void); /* unrecognized option character */
+FAR char **getoptargp(void); /* Optional argument following option */
+int *getopindgp(void); /* Index into argv */
+int *getoptoptp(void); /* unrecognized option character */
#undef EXTERN
#if defined(__cplusplus)
diff --git a/nuttx/libc/misc/lib_init.c b/nuttx/libc/misc/lib_init.c
index ca5e5d037..b120b5084 100644
--- a/nuttx/libc/misc/lib_init.c
+++ b/nuttx/libc/misc/lib_init.c
@@ -104,7 +104,7 @@ void lib_streaminit(FAR struct streamlist *list)
/* Indicate not opened */
- list->sl_streams[i].fs_filedes = -1;
+ list->sl_streams[i].fs_fd = -1;
/* Initialize the stream semaphore to one to support one-at-
* a-time access to private data sets.
@@ -152,5 +152,3 @@ void lib_releaselist(FAR struct streamlist *list)
#endif /* !CONFIG_NUTTX_KERNEL || __KERNEL__ */
#endif /* CONFIG_NFILE_STREAMS */
-
-
diff --git a/nuttx/libc/stdio/lib_fclose.c b/nuttx/libc/stdio/lib_fclose.c
index c04537adf..50e7e63bc 100644
--- a/nuttx/libc/stdio/lib_fclose.c
+++ b/nuttx/libc/stdio/lib_fclose.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_fclose.c
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011, 3013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -80,9 +80,9 @@ int fclose(FAR FILE *stream)
/* Check that the underlying file descriptor corresponds to an an open
* file.
*/
-
+
ret = OK;
- if (stream->fs_filedes >= 0)
+ if (stream->fs_fd >= 0)
{
/* If the stream was opened for writing, then flush the stream */
@@ -94,7 +94,7 @@ int fclose(FAR FILE *stream)
/* Close the underlying file descriptor and save the return status */
- status = close(stream->fs_filedes);
+ status = close(stream->fs_fd);
/* If close() returns an error but flush() did not then make sure
* that we return the close() error condition.
@@ -132,9 +132,9 @@ int fclose(FAR FILE *stream)
stream->fs_oflags = 0;
#endif
- /* Setting the fs_filedescriptor to -1 makes the stream available for reuse */
+ /* Setting the file descriptor to -1 makes the stream available for reuse */
- stream->fs_filedes = -1;
+ stream->fs_fd = -1;
}
/* On an error, reset the errno to the first error encountered and return
@@ -151,4 +151,3 @@ int fclose(FAR FILE *stream)
return OK;
}
-
diff --git a/nuttx/libc/stdio/lib_fgets.c b/nuttx/libc/stdio/lib_fgets.c
index 87eed285d..198e44be5 100644
--- a/nuttx/libc/stdio/lib_fgets.c
+++ b/nuttx/libc/stdio/lib_fgets.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_fgets.c
*
- * Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2008, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -119,7 +119,7 @@ char *fgets(FAR char *buf, int buflen, FILE *stream)
/* Sanity checks */
- if (!stream || !buf || buflen < 1 || stream->fs_filedes < 0)
+ if (!stream || !buf || buflen < 1 || stream->fs_fd < 0)
{
return NULL;
}
@@ -204,4 +204,3 @@ char *fgets(FAR char *buf, int buflen, FILE *stream)
}
}
}
-
diff --git a/nuttx/libc/stdio/lib_fileno.c b/nuttx/libc/stdio/lib_fileno.c
index f227aa372..dff72becc 100644
--- a/nuttx/libc/stdio/lib_fileno.c
+++ b/nuttx/libc/stdio/lib_fileno.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_fileno.c
*
- * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,7 @@ int fileno(FAR FILE *stream)
int ret = -1;
if (stream)
{
- ret = stream->fs_filedes;
+ ret = stream->fs_fd;
}
if (ret < 0)
@@ -67,4 +67,3 @@ int fileno(FAR FILE *stream)
return ret;
}
#endif /* CONFIG_NFILE_STREAMS */
-
diff --git a/nuttx/libc/stdio/lib_fseek.c b/nuttx/libc/stdio/lib_fseek.c
index 36216d94a..762682cb9 100644
--- a/nuttx/libc/stdio/lib_fseek.c
+++ b/nuttx/libc/stdio/lib_fseek.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_fseek.c
*
- * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -101,7 +101,7 @@
* function on the same stream.
*
* Returned Value:
- * Zero on succes; -1 on failure with errno set appropriately.
+ * Zero on succes; -1 on failure with errno set appropriately.
*
****************************************************************************/
@@ -132,7 +132,5 @@ int fseek(FAR FILE *stream, long int offset, int whence)
/* Perform the fseek on the underlying file descriptor */
- return lseek(stream->fs_filedes, offset, whence) == (off_t)-1 ? ERROR : OK;
+ return lseek(stream->fs_fd, offset, whence) == (off_t)-1 ? ERROR : OK;
}
-
-
diff --git a/nuttx/libc/stdio/lib_ftell.c b/nuttx/libc/stdio/lib_ftell.c
index 99fc20f34..c528c4702 100644
--- a/nuttx/libc/stdio/lib_ftell.c
+++ b/nuttx/libc/stdio/lib_ftell.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_ftell.c
*
- * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -95,7 +95,7 @@
* stream pointed to by stream.
*
* Returned Value:
- * Zero on succes; -1 on failure with errno set appropriately.
+ * Zero on succes; -1 on failure with errno set appropriately.
*
****************************************************************************/
@@ -115,7 +115,7 @@ long ftell(FAR FILE *stream)
* file pointer, but will return its current setting
*/
- position = lseek(stream->fs_filedes, 0, SEEK_CUR);
+ position = lseek(stream->fs_fd, 0, SEEK_CUR);
if (position != (off_t)-1)
{
return (long)position;
@@ -125,5 +125,3 @@ long ftell(FAR FILE *stream)
return ERROR;
}
}
-
-
diff --git a/nuttx/libc/stdio/lib_libfflush.c b/nuttx/libc/stdio/lib_libfflush.c
index f2f0cfe14..07b230b54 100644
--- a/nuttx/libc/stdio/lib_libfflush.c
+++ b/nuttx/libc/stdio/lib_libfflush.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_libfflush.c
*
- * Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2008, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -112,7 +112,7 @@ ssize_t lib_fflush(FAR FILE *stream, bool bforce)
/* Return EBADF if the file is not opened for writing */
- if (stream->fs_filedes < 0 || (stream->fs_oflags & O_WROK) == 0)
+ if (stream->fs_fd < 0 || (stream->fs_oflags & O_WROK) == 0)
{
return -EBADF;
}
@@ -150,7 +150,7 @@ ssize_t lib_fflush(FAR FILE *stream, bool bforce)
{
/* Perform the write */
- bytes_written = write(stream->fs_filedes, src, nbuffer);
+ bytes_written = write(stream->fs_fd, src, nbuffer);
if (bytes_written < 0)
{
/* Write failed. The cause of the failure is in 'errno'.
diff --git a/nuttx/libc/stdio/lib_libflushall.c b/nuttx/libc/stdio/lib_libflushall.c
index 22baed968..9bb94c5c8 100644
--- a/nuttx/libc/stdio/lib_libflushall.c
+++ b/nuttx/libc/stdio/lib_libflushall.c
@@ -111,7 +111,7 @@ int lib_flushall(FAR struct streamlist *list)
* write data in the stream.
*/
- if (stream->fs_filedes >= 0 && (stream->fs_oflags & O_WROK) != 0)
+ if (stream->fs_fd >= 0 && (stream->fs_oflags & O_WROK) != 0)
{
/* Flush the writable FILE */
diff --git a/nuttx/libc/stdio/lib_libfread.c b/nuttx/libc/stdio/lib_libfread.c
index f8cf0f40a..17b3998c2 100644
--- a/nuttx/libc/stdio/lib_libfread.c
+++ b/nuttx/libc/stdio/lib_libfread.c
@@ -178,7 +178,7 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
if (count > buffer_available)
{
- bytes_read = read(stream->fs_filedes, dest, count);
+ bytes_read = read(stream->fs_fd, dest, count);
if (bytes_read < 0)
{
/* An error occurred on the read. The error code is
@@ -226,7 +226,7 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
* into the buffer.
*/
- bytes_read = read(stream->fs_filedes, stream->fs_bufread, buffer_available);
+ bytes_read = read(stream->fs_fd, stream->fs_bufread, buffer_available);
if (bytes_read < 0)
{
/* An error occurred on the read. The error code is
@@ -258,7 +258,7 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
while (count > 0)
{
- bytes_read = read(stream->fs_filedes, dest, count);
+ bytes_read = read(stream->fs_fd, dest, count);
if (bytes_read < 0)
{
/* An error occurred on the read. The error code is
@@ -307,12 +307,11 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
lib_give_semaphore(stream);
}
- return bytes_read;
+ return bytes_read;
/* Error exits */
errout_with_errno:
lib_give_semaphore(stream);
- return -get_errno();
+ return -get_errno();
}
-
diff --git a/nuttx/libc/stdio/lib_libfwrite.c b/nuttx/libc/stdio/lib_libfwrite.c
index b917b3b56..e7443f996 100644
--- a/nuttx/libc/stdio/lib_libfwrite.c
+++ b/nuttx/libc/stdio/lib_libfwrite.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_libfwrite.c
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,6 @@ errout:
}
#else
{
- return write(stream->fs_filedes, ptr, count);
+ return write(stream->fs_fd, ptr, count);
}
#endif /* CONFIG_STDIO_BUFFER_SIZE */
-
diff --git a/nuttx/libc/stdio/lib_ungetc.c b/nuttx/libc/stdio/lib_ungetc.c
index 178aeddd1..9d14499d7 100644
--- a/nuttx/libc/stdio/lib_ungetc.c
+++ b/nuttx/libc/stdio/lib_ungetc.c
@@ -1,7 +1,7 @@
/****************************************************************************
* libc/stdio/lib_ungetc.c
*
- * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ int ungetc(int c, FAR FILE *stream)
/* Stream must be open for read access */
- if ((stream && stream->fs_filedes < 0) ||
+ if ((stream && stream->fs_fd < 0) ||
((stream->fs_oflags & O_RDOK) == 0))
{
set_errno(EBADF);
diff --git a/nuttx/net/net_vfcntl.c b/nuttx/net/net_vfcntl.c
index 7650264bf..a4c924225 100644
--- a/nuttx/net/net_vfcntl.c
+++ b/nuttx/net/net_vfcntl.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/net_vfcntl.c
*
- * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -97,14 +97,14 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
case F_GETFD:
/* Get the file descriptor flags defined in <fcntl.h> that are associated
- * with the file descriptor fildes. File descriptor flags are associated
+ * with the file descriptor fd. File descriptor flags are associated
* with a single file descriptor and do not affect other file descriptors
* that refer to the same file.
*/
case F_SETFD:
/* Set the file descriptor flags defined in <fcntl.h>, that are associated
- * with fildes, to the third argument, arg, taken as type int. If the
+ * with fd, to the third argument, arg, taken as type int. If the
* FD_CLOEXEC flag in the third argument is 0, the file shall remain open
* across the exec functions; otherwise, the file shall be closed upon
* successful execution of one of the exec functions.
@@ -115,7 +115,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
case F_GETFL:
/* Get the file status flags and file access modes, defined in <fcntl.h>,
- * for the file description associated with fildes. The file access modes
+ * for the file description associated with fd. The file access modes
* can be extracted from the return value using the mask O_ACCMODE, which is
* defined in <fcntl.h>. File status flags and file access modes are associated
* with the file description and do not affect other file descriptors that
@@ -140,7 +140,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
case F_SETFL:
/* Set the file status flags, defined in <fcntl.h>, for the file description
- * associated with fildes from the corresponding bits in the third argument,
+ * associated with fd from the corresponding bits in the third argument,
* arg, taken as type int. Bits corresponding to the file access mode and
* the file creation flags, as defined in <fcntl.h>, that are set in arg shall
* be ignored. If any bits in arg other than those mentioned here are changed
@@ -170,18 +170,18 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
break;
case F_GETOWN:
- /* If fildes refers to a socket, get the process or process group ID specified
+ /* If fd refers to a socket, get the process or process group ID specified
* to receive SIGURG signals when out-of-band data is available. Positive values
* indicate a process ID; negative values, other than -1, indicate a process group
- * ID. If fildes does not refer to a socket, the results are unspecified.
+ * ID. If fd does not refer to a socket, the results are unspecified.
*/
case F_SETOWN:
- /* If fildes refers to a socket, set the process or process group ID specified
+ /* If fd refers to a socket, set the process or process group ID specified
* to receive SIGURG signals when out-of-band data is available, using the value
- * of the third argument, arg, taken as type int. Positive values indicate a
+ * of the third argument, arg, taken as type int. Positive values indicate a
* process ID; negative values, other than -1, indicate a process group ID. If
- * fildes does not refer to a socket, the results are unspecified.
+ * fd does not refer to a socket, the results are unspecified.
*/
case F_GETLK: