diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 04466e4278b..9e5c8122a9b 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: August 13, 2013
+Last Updated: September 28, 2013
@@ -2806,13 +2806,13 @@ extern void up_ledoff(int led); Each character device driver must implement an instance ofstruct file_operations.
That structure defines a call table with the following methods:
int open(FAR struct file *filp);
- 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 poll(FAR struct file *filp, struct pollfd *fds, bool setup);
int open(FAR struct file *filep);
+ 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);
+ int poll(FAR struct file *filep, struct pollfd *fds, bool setup);
User's Manual
by
Gregory Nutt
-
Last Updated: June 4, 2013
+Last Updated: September 28, 2013
@@ -250,14 +250,14 @@ paragraphs.-Function Prototype: +Function Prototype:
#include <sched.h> int task_create(char *name, int priority, int stack_size, main_t entry, char * const argv[]);
-Description: +Description: This function creates and activates a new task with a specified priority and returns its system-assigned ID.
@@ -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.-Input Parameters: +Input Parameters:
name. Name of the new taskpriority. Priority of the new task- Returned Value: + Returned Value:
-Assumptions/Limitations: +Assumptions/Limitations:
POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: @@ -339,7 +339,7 @@ VxWorks provides the following similar interface:
-Function Prototype: +Function Prototype:
#include <sched.h>
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().
-Input Parameters:
+Input Parameters:
tcb. Address of the new task's TCB
name. Name of the new task (not used)
@@ -374,7 +374,7 @@ VxWorks provides the following similar interface:
-Returned Value: +Returned Value:
OK, or ERROR if the task cannot be initialized.
@@ -411,7 +411,7 @@ VxWorks provides the following similar interface:-Function Prototype: +Function Prototype:
#include <sched.h>
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.
-Input Parameters:
+Input Parameters:
tcb. The TCB for the task for the task (same as the
task_init argument).
-Returned Value: +Returned Value:
errno is not set).
-Function Prototype: +Function Prototype:
#include <sched.h> 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().-Input Parameters: +Input Parameters:
pid.
@@ -481,7 +481,7 @@ int task_delete(pid_t pid);
Any attempt by the calling task will be automatically re-directed to exit().
-Returned Value: +Returned Value:
OK, or ERROR if the task cannot be deleted.
@@ -489,7 +489,7 @@ int task_delete(pid_t pid);
-Assumptions/Limitations: +Assumptions/Limitations:
task_delete() must be used with caution:
If the task holds resources (for example, allocated memory or semaphores needed by other tasks), then task_delete() can strand those resources.
@@ -544,14 +544,14 @@ int task_restart(pid_t pid);
-Input Parameters: +Input Parameters:
pid.
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).
-Returned Value: +Returned Value:
-Assumptions/Limitations: +Assumptions/Limitations:
POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: @@ -586,7 +586,7 @@ VxWorks provides the following similar interface:
-Function Prototype: +Function Prototype:
#include <sched.h>
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 atexit() or on_exit().
-Input Parameters:
+Input Parameters:
code. (ignored)
atexit() or on_exit()Returned Value: None.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: This is equivalent to the ANSI interface:
@@ -632,7 +632,7 @@ And the UNIX interface:
2.1.7 getpid
-Function Prototype:
+Function Prototype:
#include <unistd.h>
pid_t getpid(void);
@@ -645,13 +645,13 @@ level.
Input Parameters: None.
-Returned Value:
+Returned Value:
- The task ID of the calling task.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility:
Compatible with the POSIX interface of the same name.
@@ -667,7 +667,7 @@ pid_t vfork(void);
Description:
- The vfork() function has the same effect as fork(), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit() or one of the exec family of functions.
+ The vfork() function has the same effect as fork(), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit() or one of the exec family of functions.
NOTE:
@@ -679,12 +679,12 @@ pid_t vfork(void);
None.
- Returned Value:
+ Returned Value:
Upon successful completion, vfork() 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 errno is set to indicate the error.
+ Otherwise, -1 is returned to the parent, no child process is created, and errno is set to indicate the error.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -765,11 +765,11 @@ int execv(FAR const char *path, FAR char *const argv[]);
- Returned Value:
+ Returned Value:
This function does not return on success.
- On failure, it will return -1 (ERROR) and will set the errno value appropriately.
+ On failure, it will return -1 (ERROR) and will set the errno value appropriately.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -804,16 +804,16 @@ int execl(FAR const char *path, ...);
...:
- 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.
- Returned Value:
+ Returned Value:
This function does not return on success.
- On failure, it will return -1 (ERROR) and will set the errno value appropriately.
+ On failure, it will return -1 (ERROR) and will set the errno value appropriately.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -924,7 +924,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
- Returned Value:
+ Returned Value:
posix_spawn() and posix_spawnp() will return zero on success.
Otherwise, an error number will be returned as the function return value to indicate the error:
@@ -938,7 +938,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
- Assumptions/Limitations:
+ Assumptions/Limitations:
-
@@ -1013,7 +1013,7 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1044,7 +1044,7 @@ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actio
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1081,7 +1081,7 @@ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_action
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1126,7 +1126,7 @@ int posix_spawn_file_actions_addopen(FAR posix_spawn_file_actions_t *file_action
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1162,7 +1162,7 @@ int posix_spawnattr_init(FAR posix_spawnattr_t *attr);
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1192,7 +1192,7 @@ int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr, FAR short *flags
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1222,7 +1222,7 @@ int posix_spawnattr_getschedparam(FAR const posix_spawnattr_t *attr, FAR struct
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1252,7 +1252,7 @@ int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr, FAR int *p
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1284,7 +1284,7 @@ int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr, FAR sigset_t *
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1314,7 +1314,7 @@ int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags);
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1347,7 +1347,7 @@ int posix_spawnattr_setschedparam(FAR posix_spawnattr_t *attr, FAR const struct
Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
-
+
2.1.24 posix_spawnattr_setschedpolicy
Function Prototype:
@@ -1406,7 +1406,7 @@ int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr, FAR const sigset_t *
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1515,7 +1515,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
- Returned Value:
+ Returned Value:
task_spawn() will return zero on success.
Otherwise, an error number will be returned as the function return value to indicate the error:
@@ -1550,7 +1550,7 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, FAR size_t *s
- Returned Value:
+ Returned Value:
On success, this function returns 0; on failure it will return an error number from <errno.h>
@@ -1712,7 +1712,7 @@ int posix_spawn_file_actions_init(FAR posix_spawn_file_actions_t *file_actions);
2.2.2 sched_getparam
-Function Prototype:
+Function Prototype:
#include <sched.h>
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);
Description: This function gets the scheduling priority
of the task specified by pid.
-Input Parameters:
+Input Parameters:
-
pid. The task ID of the task.
@@ -1736,20 +1736,20 @@ of the task specified by pid.
-Returned Value:
+Returned Value:
- 0 (
OK) if successful, otherwise -1 (ERROR).
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
2.2.3 sched_setscheduler
- Function Prototype:
+ Function Prototype:
#include <sched.h>
@@ -1762,7 +1762,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
The parameter param holds the priority of the thread under the new policy.
- Input Parameters:
+ Input Parameters:
-
@@ -1781,7 +1781,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
- Returned Value:
+ Returned Value:
On success, sched_setscheduler() returns OK (zero). On
error, ERROR (-1) is returned, and errno is set appropriately:
@@ -1798,7 +1798,7 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
2.2.4 sched_getscheduler
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_getscheduler (pid_t pid);
@@ -1810,7 +1810,7 @@ int sched_getscheduler (pid_t pid);
pid equals zero, the policy of the calling process will
be retrieved.
-Input Parameters:
+Input Parameters:
pid.
The task ID of the task to query.
@@ -1818,7 +1818,7 @@ int sched_getscheduler (pid_t pid);
-Returned Value:
+Returned Value:
-
On success,
sched_getscheduler() returns the policy for
@@ -1830,14 +1830,14 @@ int sched_getscheduler (pid_t pid);
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX interface of the same name.
2.2.5 sched_yield
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_yield(void);
@@ -1849,13 +1849,13 @@ up the CPU (only to other tasks at the same priority).
Input Parameters: None.
-Returned Value:
+Returned Value:
- 0 (
OK) or -1 (ERROR)
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -1863,7 +1863,7 @@ interface of the same name.
2.2.6 sched_get_priority_max
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_get_priority_max (int policy)
@@ -1873,19 +1873,19 @@ interface of the same name.
Description: This function returns the value of the highest
possible task priority for a specified scheduling policy.
-Input Parameters:
+Input Parameters:
policy. Scheduling policy requested.
-Returned Value:
+Returned Value:
- The maximum priority value or -1 (
ERROR).
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -1893,7 +1893,7 @@ interface of the same name.
2.2.7 sched_get_priority_min
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_get_priority_min (int policy);
@@ -1903,19 +1903,19 @@ interface of the same name.
Description: This function returns the value of the lowest
possible task priority for a specified scheduling policy.
-Input Parameters:
+Input Parameters:
policy. Scheduling policy requested.
-Returned Value:
+Returned Value:
- The minimum priority value or -1 (
ERROR)
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -1923,14 +1923,14 @@ interface of the same name.
2.2.8 sched_get_rr_interval
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_get_rr_interval (pid_t pid, struct timespec *interval);
- Description:
+ Description:
sched_rr_get_interval() writes the timeslice interval
for task identified by pid into the timespec structure
pointed to by interval. If pid is zero, the timeslice
@@ -1939,7 +1939,7 @@ interface of the same name.
scheduling policy.'
- Input Parameters:
+ Input Parameters:
pid. The task ID of the task. If pid is zero, the
@@ -1948,7 +1948,7 @@ priority of the calling task is returned.
- Returned Value:
+ Returned Value:
On success, sched_rr_get_interval() returns OK (0). On
error, ERROR (-1) is returned, and errno is set to:
@@ -1960,7 +1960,7 @@ priority of the calling task is returned.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -2100,7 +2100,7 @@ int ret = sigaction(SIGCHLD, &sa, NULL);
2.3.1 sched_lock
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_lock(void);
@@ -2115,13 +2115,13 @@ number of times) or until it blocks itself.
Input Parameters: None.
-Returned Value:
+Returned Value:
- OK or ERROR.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: This is a NON-POSIX interface.
VxWorks provides the comparable interface:
@@ -2132,7 +2132,7 @@ VxWorks provides the comparable interface:
2.3.2 sched_unlock
-Function Prototype:
+Function Prototype:
#include <sched.h>
int sched_unlock(void);
@@ -2148,13 +2148,13 @@ eligible to preempt the current task will execute.
Input Parameters: None.
-Returned Value:
+Returned Value:
- OK or ERROR.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: This is a NON-POSIX interface.
VxWorks provides the comparable interface:
@@ -2165,7 +2165,7 @@ VxWorks provides the comparable interface:
2.3.3 sched_lockcount
-Function Prototype:
+Function Prototype:
#include <sched.h>
int32_t sched_lockcount(void)
@@ -2179,13 +2179,13 @@ on this thread of execution.
Input Parameters: None.
-Returned Value:
+Returned Value:
- The current value of the lockCount.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: None.
@@ -2193,14 +2193,14 @@ on this thread of execution.
2.3.4 waitpid
-Function Prototype:
+Function Prototype:
#include <sys/wait.h>
ipid_t waitpid(pid_t pid, int *stat_loc, int options);
- Description:
+ Description:
The following discussion is a general description of the waitpid() interface.
@@ -2223,7 +2223,7 @@ on this thread of execution.
Because waitpid() is not fully POSIX compliant, it must be specifically enabled by setting CONFIG_SCHED_WAITPID in the NuttX configuration file.
- Input Parameters:
+ Input Parameters:
pid. The task ID of the thread to waid for
@@ -2256,19 +2256,19 @@ on this thread of execution.
-
WCONTINUED.
- The waitpid() 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 waitpid() 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.
-
WNOHANG.
- The waitpid() function will not suspend execution of the calling thread if status is not immediately available for one of the child processes specified by pid.
+ The waitpid() function will not suspend execution of the calling thread if status is not immediately available for one of the child processes specified by pid.
-
WUNTRACED.
- The status of any child processes specified by pid 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 pid that are stopped, and whose status has not yet been reported since they stopped, will also be reported to the requesting process.
- If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, 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 waitpid() will fail and set errno to ECHILD.
+ If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, 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 waitpid() will fail and set errno to ECHILD.
If waitpid() 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.
-
WEXITSTATUS(stat_val).
- If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to _exit() or exit(), or the value the child process returned from main().
+ If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to _exit() or exit(), or the value the child process returned from main().
-
WIFSIGNALED(stat_val).
- 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 >signal.h<).
+ 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 >signal.h<).
-
WTERMSIG(stat_val).
- If the value of WIFSIGNALED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
+ If the value of WIFSIGNALED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
-
WIFSTOPPED(stat_val).
- 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.
-
WSTOPSIG(stat_val).
- If the value of WIFSTOPPED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
+ If the value of WIFSTOPPED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
-
WIFCONTINUED(stat_val).
@@ -2320,7 +2320,7 @@ on this thread of execution.
- Returned Value:
+ Returned Value:
If waitpid() 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.
-
ECHILD.
- The process specified by pid does not exist or is not a child of the calling process, or the process group specified by pid does not exist or does not have any member process that is a child of the calling process.
+ The process specified by pid does not exist or is not a child of the calling process, or the process group specified by pid does not exist or does not have any member process that is a child of the calling process.
-
EINTR.
The function was interrupted by a signal.
- The value of the location pointed to by stat_loc is undefined.
+ The value of the location pointed to by stat_loc is undefined.
-
EINVAL.
- The options argument is not valid.
+ The options argument is not valid.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
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.
2.3.5 waitid
-Function Prototype:
+Function Prototype:
#include <sys/wait.h>
#ifdef CONFIG_SCHED_HAVE_PARENT
@@ -2406,25 +2406,25 @@ on this thread of execution.
-
WEXITED:
- Wait for processes that have exited.
+ Wait for processes that have exited.
-
WSTOPPED:
- 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.
-
WCONTINUES:
- 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.
-
WNOHANG:
- Return immediately if there are no children to wait for.
+ Return immediately if there are no children to wait for.
-
WNOWAIT:
Keep the process whose status is returned in info 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.
The info argument must point to a siginfo_t structure.
@@ -2436,9 +2436,9 @@ on this thread of execution.
See the description above.
- Returned Value:
+ Returned Value:
If waitid() returns due to the change of state of one of its children, 0 is returned.
- Otherwise, -1 is returned and errno is set to indicate the error.
+ Otherwise, -1 is returned and errno is set to indicate the error.
The waitid() function will fail if:
@@ -2447,18 +2447,18 @@ on this thread of execution.
ECHILD:
- The calling process has no existing unwaited-for child processes.
+ The calling process has no existing unwaited-for child processes.
EINTR:
- The waitid() function was interrupted by a signal.
+ The waitid() function was interrupted by a signal.
EINVAL:
An invalid value was specified for options, or idtype and id specify an invalid set of processes.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
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.
2.3.6 wait
-Function Prototype:
+Function Prototype:
#include <sys/wait.h>
#ifdef CONFIG_SCHED_HAVE_PARENT
@@ -2474,7 +2474,7 @@ on this thread of execution.
#endif
- Description:
+ Description:
The following discussion is a general description of the wait() interface.
@@ -2492,17 +2492,17 @@ on this thread of execution.
Otherwise, its behavior will be modified by the values of the pid and options arguments.
- Input Parameters:
+ Input Parameters:
stat_loc. The location to return the exit status
- Returned Value:
+ Returned Value:
See the values returned by waitpaid().
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
Comparable to the POSIX interface of the same name, but the implementation is incomplete (as detailed in the description waitpaid()).
@@ -2511,13 +2511,13 @@ on this thread of execution.
2.3.7 atexit
-Function Prototype:
+Function Prototype:
#include <stdlib.h>
int atexit(void (*func)(void));
- Description:
+ Description:
Registers a function to be called at program exit.
The atexit() function registers the given function to be called at normal process termination, whether via exit() or via return from the program's main().
@@ -2525,19 +2525,19 @@ on this thread of execution.
NOTE: CONFIG_SCHED_ATEXIT must be defined to enable this function.
- Input Parameters:
+ Input Parameters:
func. A pointer to the function to be called when the task exits.
- Returned Value:
+ Returned Value:
On success, atexit() returns OK (0).
On error, ERROR (-1) is returned, and errno is set to indicate the cause of the failure.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility: Comparable to the ISO C interface of the same name.
Limitiations in the current implementation:
@@ -2550,13 +2550,13 @@ on this thread of execution.
2.3.8 on_exit
-Function Prototype:
+Function Prototype:
#include <stdlib.h>
int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg)
- Description:
+ Description:
Registers a function to be called at program exit.
The on_exit() function registers the given function to be called at normal process termination, whether via exit() or via return from the program's main().
The function is passed the status argument given to the last call to exit() and the arg argument from on_exit().
@@ -2565,25 +2565,25 @@ on this thread of execution.
NOTE: CONFIG_SCHED_ONEXIT must be defined to enable this function
- Input Parameters:
+ Input Parameters:
func. A pointer to the function to be called when the task exits.
arg. An argument that will be provided to the on_exit() function when the task exits.
- Returned Value:
+ Returned Value:
On success, on_exit() returns OK (0).
On error, ERROR (-1) is returned, and errno is set to indicate the cause of the failure.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
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 atexit() instead.
+ Avoid this function, and use the standard atexit() instead.
- Only a single
on_exit function can be registered unless CONFIG_SCHED_ONEXIT_MAX defines a larger number.
@@ -2619,7 +2619,7 @@ on this thread of execution.
2.4.1 mq_open
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
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().
-Input Parameters:
+Input Parameters:
mqName. Name of the queue to open
oflags. 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
-Returned Value:
+Returned Value:
- A message queue descriptor or -1 (
ERROR)
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX interface
of the same name.
@@ -2688,7 +2688,7 @@ message size is limited at 22 bytes.
2.4.2 mq_close
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
int mq_close(mqd_t mqdes);
@@ -2705,20 +2705,20 @@ queue via this mqdes (see mq_notify()), this attachmen
removed and the message queue is available for another task to attach
for notification.
-Input Parameters:
+Input Parameters:
mqdes. Message queue descriptor.
-Returned Value:
+Returned Value:
- 0 (
OK) if the message queue is closed successfully, otherwise,
-1 (ERROR).
-Assumptions/Limitations:
+Assumptions/Limitations:
-
@@ -2735,7 +2735,7 @@ of the same name.
2.4.3 mq_unlink
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
int mq_unlink(const char *mqName);
@@ -2748,7 +2748,7 @@ open when mq_unlink() is called, removal of the message queue
is postponed until all references to the message queue have been
closed.
-Input Parameters:
+Input Parameters:
mqName. Name of the message queue
@@ -2756,14 +2756,14 @@ closed.
Returned Value: None.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
2.4.4 mq_send
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
@@ -2808,7 +2808,7 @@ interface of the same name.
- Input Parameters:
+ Input Parameters:
mqdes. Message queue descriptor.
@@ -2845,7 +2845,7 @@ interface of the same name.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -2853,7 +2853,7 @@ interface of the same name.
mq_timedsend
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
@@ -2891,7 +2891,7 @@ interface of the same name.
of the call, mq_timedsend() returns immediately.
- Input Parameters:
+ Input Parameters:
mqdes. Message queue descriptor.
@@ -2928,7 +2928,7 @@ interface of the same name.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -2937,7 +2937,7 @@ interface of the same name.
2.4.5 mq_receive
- Function Prototype:
+ Function Prototype:
#include <mqueue.h>
@@ -2962,7 +2962,7 @@ interface of the same name.
If the queue is empty and O_NONBLOCK is set, ERROR will be returned.
- Input Parameters:
+ Input Parameters:
mqdes. Message Queue Descriptor.
@@ -2998,7 +2998,7 @@ interface of the same name.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -3007,7 +3007,7 @@ interface of the same name.
2.4.6 mq_timedreceive
- Function Prototype:
+ Function Prototype:
#include <mqueue.h>
@@ -3042,7 +3042,7 @@ interface of the same name.
the call, mq_timedreceive() returns immediately.
- Input Parameters:
+ Input Parameters:
mqdes. Message Queue Descriptor.
@@ -3083,7 +3083,7 @@ interface of the same name.
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -3093,7 +3093,7 @@ interface of the same name.
2.4.7 mq_notify
- Function Prototype:
+ Function Prototype:
#include <mqueue.h>
int mq_notify(mqd_t mqdes, const struct sigevent *notification);
@@ -3135,16 +3135,16 @@ interface of the same name.
errno set to indicate the error:
-
-
EBADF. The descriptor specified in mqdes is invalid.
+ EBADF. The descriptor specified in mqdes is invalid.
-
EBUSY. Another process has already registered to receive notification
- for this message queue.
+ for this message queue.
-
EINVAL. sevp->sigev_notify is not one of the permitted values; or
sevp->sigev_notify is SIGEV_SIGNAL and sevp->sigev_signo is not a
- valid signal number.
+ valid signal number.
-
ENOMEM. Insufficient memory.
@@ -3174,7 +3174,7 @@ interface of the same name.
2.4.8 mq_setattr
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqStat,
@@ -3190,7 +3190,7 @@ If "oldMqStat" is non-null, mq_setattr() will store
the previous message queue attributes at that location (just as
would have been returned by mq_getattr()).
-Input Parameters:
+Input Parameters:
mqdes. Message queue descriptor
mqStat. New attributes
@@ -3198,14 +3198,14 @@ would have been returned by mq_getattr()).
-Returned Value:
+Returned Value:
- 0 (
OK) if attributes are set successfully, otherwise -1
(ERROR).
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3213,7 +3213,7 @@ interface of the same name.
2.4.9 mq_getattr
-Function Prototype:
+Function Prototype:
#include <mqueue.h>
int mq_getattr(mqd_t mqdes, struct mq_attr *mqStat);
@@ -3223,7 +3223,7 @@ interface of the same name.
Description: This functions gets status information and
attributes associated with the specified message queue.
-Input Parameters:
+Input Parameters:
mqdes. Message queue descriptor
mqStat. Buffer in which to return attributes. The returned
@@ -3238,13 +3238,13 @@ attributes include:
-Returned Value:
+Returned Value:
- 0 (
OK) if attributes provided, -1 (ERROR) otherwise.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3400,7 +3400,7 @@ interface of the same name.
2.5.1 sem_init
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
int sem_init(sem_t *sem, int pshared, unsigned int value);
@@ -3417,21 +3417,21 @@ result of referring to copies of sem in calls to sem_wait()
sem_trywait(), sem_post(), and sem_destroy(), is
not defined.
-Input Parameters:
+Input Parameters:
sem. Semaphore to be initialized
pshared. Process sharing (not used)
-value. Semaphore initialization value
+value. Semaphore initialization value
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if unsuccessful.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3443,7 +3443,7 @@ Differences from the full POSIX implementation include:
2.5.2 sem_destroy
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
int sem_destroy(sem_t *sem);
@@ -3460,19 +3460,19 @@ effect of subsequent use of the semaphore sem is undefined until
The effect of destroying a semaphore upon which other tasks are currently
blocked is undefined.
-Input Parameters:
+Input Parameters:
sem. Semaphore to be destroyed.
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if unsuccessful.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3480,7 +3480,7 @@ interface of the same name.
2.5.3 sem_open
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
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()).
-Input Parameters:
+Input Parameters:
name. Semaphore name
oflag. 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:
-mode. The mode parameter is of type mode_t.
+mode. The mode parameter is of type mode_t.
This parameter is required but not used in the present
implementation.
value. The value parameter is type unsigned int. The semaphore
@@ -3527,13 +3527,13 @@ semaphores must be less than or equal to SEM_VALUE_MAX (defined in
-Returned Value:
+Returned Value:
- A pointer to sem_t or -1 (
ERROR) if unsuccessful.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3546,7 +3546,7 @@ just a counting semaphore.
2.5.4 sem_close
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
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.
-Input Parameters:
+Input Parameters:
sem. Semaphore descriptor
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if unsuccessful.
@@ -3591,7 +3591,7 @@ interface of the same name.
2.5.5 sem_unlink
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
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().
-Input Parameters:
+Input Parameters:
name. Semaphore name
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if unsuccessful.
-Assumptions/Limitations:
+Assumptions/Limitations:
- 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.
2.5.6 sem_wait
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
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.
-Input Parameters:
+Input Parameters:
sem. Semaphore descriptor.
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) is unsuccessful
@@ -3671,7 +3671,7 @@ not valid.
received by this task. In this case, the semaphore has not be acquired.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3679,7 +3679,7 @@ interface of the same name.
2.5.7 sem_timedwait
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
#include <time.h>
@@ -3687,7 +3687,7 @@ interface of the same name.
-Description:
+Description:
This function will lock the semaphore referenced by sem as in the sem_wait() function.
However, if the semaphore cannot be locked without waiting for another process or thread to unlock the semaphore by performing a sem_post() function, this wait will be terminated when the specified timeout expires.
@@ -3695,7 +3695,7 @@ interface of the same name.
This function attempts to lock the semaphore 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.
-Input Parameters:
+Input Parameters:
-
sem. Semaphore descriptor.
@@ -3706,7 +3706,7 @@ interface of the same name.
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) is unsuccessful
@@ -3748,7 +3748,7 @@ The following lists the possible values for errno
2.5.8 sem_trywait
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
int sem_trywait(sem_t *sem);
@@ -3759,13 +3759,13 @@ The following lists the possible values for errno
only if the semaphore is currently not locked. In any event, the call
returns without blocking.
-Input Parameters:
+Input Parameters:
sem. The semaphore descriptor
-Returned Value:
+Returned Value:
- 0 (
OK) or -1 (ERROR) if unsuccessful
@@ -3781,7 +3781,7 @@ not valid.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3789,7 +3789,7 @@ interface of the same name.
2.5.9 sem_post
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
int sem_post(sem_t *sem);
@@ -3810,13 +3810,13 @@ return successfully from its call to sem_wait().
NOTE: sem_post() may be called from an interrupt handler.
-Input Parameters:
+Input Parameters:
sem. Semaphore descriptor
-Returned Value:
+Returned Value:
- 0 (
OK) or -1 (ERROR) if unsuccessful.
@@ -3832,7 +3832,7 @@ interface of the same name.
2.5.10 sem_getvalue
-Function Prototype:
+Function Prototype:
#include <semaphore.h>
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.
-Input Parameters:
+Input Parameters:
sem. Semaphore descriptor
sval. Buffer by which the value is returned
-Returned Value:
+Returned Value:
- 0 (
OK) or -1 (ERROR) if unsuccessful.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -3897,7 +3897,7 @@ interface of the same name.
2.6.1 wd_create
-Function Prototype:
+Function Prototype:
#include <wdog.h>
WDOG_ID wd_create(void);
@@ -3909,7 +3909,7 @@ by allocating the appropriate resources for the watchdog.
Input Parameters: None.
-Returned Value:
+Returned Value:
- 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.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
@@ -3935,7 +3935,7 @@ initialization time).
2.6.2 wd_delete
-Function Prototype:
+Function Prototype:
#include <wdog.h>
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.
-Input Parameters:
+Input Parameters:
wdog. The watchdog ID to delete. This is actually a
pointer to a watchdog structure.
-Returned Value:
+Returned Value:
- OK or ERROR
@@ -3979,7 +3979,7 @@ before deallocating it (i.e., never returns ERROR).
2.6.3 wd_start
-Function Prototype:
+Function Prototype:
#include <wdog.h>
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.
-Input Parameters:
+Input Parameters:
wdog. Watchdog ID
delay. Delay count in clock ticks
@@ -4010,7 +4010,7 @@ wd_start() on a given watchdog ID has any effect.
-Returned Value:
+Returned Value:
- OK or ERROR
@@ -4031,12 +4031,12 @@ Differences from the VxWorks interface include:
- 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
2.6.4 wd_cancel
-Function Prototype:
+Function Prototype:
#include <wdog.h>
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.
-Input Parameters:
+Input Parameters:
wdog. ID of the watchdog to cancel.
-Returned Value:
+Returned Value:
- OK or ERROR
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: 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);
- Description:
+ Description:
This function returns the time remaining before the specified watchdog expires.
@@ -4086,7 +4086,7 @@ VxWorks provides the following comparable interface:
- Returned Value:
+ Returned Value:
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.
@@ -4483,7 +4483,7 @@ VxWorks provides the following comparable interface:
If the timer_gettime() succeeds, a value of 0 (OK) will be returned.
- If an error occurs, the value -1 (ERROR) will be returned, and
+ If an error occurs, the value -1 (ERROR) will be returned, and
errno set to indicate the error.
@@ -4564,7 +4564,7 @@ VxWorks provides the following comparable interface:
timer_getoverrun() 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 DELAYTIMER_MAX. If the number of such
extra expirations is greater than or equal to DELAYTIMER_MAX, then the
overrun count will be set to DELAYTIMER_MAX. The value returned by
@@ -4722,7 +4722,7 @@ interface of the same name.
2.8.1 sigemptyset
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigemptyset(sigset_t *set);
@@ -4732,19 +4732,19 @@ interface of the same name.
Description: This function initializes the signal set specified
by set such that all signals are excluded.
-Input Parameters:
+Input Parameters:
set. Signal set to initialize.
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if the signal set cannot be initialized.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4752,7 +4752,7 @@ interface of the same name.
2.8.2 sigfillset
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigfillset(sigset_t *set);
@@ -4762,19 +4762,19 @@ interface of the same name.
Description: This function initializes the signal set specified
by set such that all signals are included.
-Input Parameters:
+Input Parameters:
set. Signal set to initialize
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if the signal set cannot be initialized.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4782,7 +4782,7 @@ interface of the same name.
2.8.3 sigaddset
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigaddset(sigset_t *set, int signo);
@@ -4792,20 +4792,20 @@ interface of the same name.
Description: This function adds the signal specified by
signo to the signal set specified by set.
-Input Parameters:
+Input Parameters:
set. Signal set to add signal to
signo. Signal to add
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if the signal number is invalid.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4813,7 +4813,7 @@ interface of the same name.
2.8.4 sigdelset
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigdelset(sigset_t *set, int signo);
@@ -4823,20 +4823,20 @@ interface of the same name.
Description: This function deletes the signal specified
by signo from the signal set specified by set.
-Input Parameters:
+Input Parameters:
set. Signal set to delete the signal from
signo. Signal to delete
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if the signal number is invalid.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4844,7 +4844,7 @@ interface of the same name.
2.8.5 sigismember
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigismember(const sigset_t *set, int signo);
@@ -4854,14 +4854,14 @@ interface of the same name.
Description: This function tests whether the signal specified
by signo is a member of the set specified by set.
-Input Parameters:
+Input Parameters:
set. Signal set to test
signo. Signal to test for
-Returned Value:
+Returned Value:
- 1 (TRUE), if the specified signal is a member of the set,
- 0 (OK or FALSE), if it is not, or
@@ -4869,7 +4869,7 @@ by signo is a member of the set specified by set.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4877,7 +4877,7 @@ interface of the same name.
2.8.6 sigaction
-Function Prototype:
+Function Prototype:
#include <signal.h>
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().
-Input Parameters:
+Input Parameters:
sig. Signal of interest
act. Location of new handler
@@ -4929,13 +4929,13 @@ sigaction().
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if the signal number is invalid.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -4954,7 +4954,7 @@ Differences from the POSIX implementation include:
2.8.7 sigprocmask
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
@@ -4972,7 +4972,7 @@ those signals will be delivered before sigprocmask() returns.
If sigprocmask() fails, the signal mask of the task is not changed.
-Input Parameters:
+Input Parameters:
how. How the signal mast will be changed:
@@ -4990,13 +4990,13 @@ pointed to by the set input parameter.
-Returned Value:
+Returned Value:
- 0 (
OK), or -1 (ERROR) if how is invalid.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -5004,7 +5004,7 @@ interface of the same name.
2.8.8 sigpending
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigpending(sigset_t *set);
@@ -5022,19 +5022,19 @@ with POSIX which states: "If a subsequent occurrence of a pending
signal is generated, it is implementation defined as to whether the signal
is delivered more than once."
-Input Parameters:
+Input Parameters:
set. The location to return the pending signal set.
-Returned Value:
+Returned Value:
- 0 (
OK) or -1 (ERROR)
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -5042,7 +5042,7 @@ interface of the same name.
2.8.9 sigsuspend
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigsuspend(const sigset_t *set);
@@ -5068,13 +5068,13 @@ suspended.
-Returned Value:
+Returned Value:
- -1 (
ERROR) always
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: 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).
2.8.10 sigwaitinfo
-Function Prototype:
+Function Prototype:
#include <signal.h>
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).
Description: This function is equivalent to sigtimedwait()
with a NULL timeout parameter. (see below).
-Input Parameters:
+Input Parameters:
set. The set of pending signals to wait for.
info. The returned signal values
-Returned Value:
+Returned Value:
- Signal number that cause the wait to be terminated, otherwise
-1 (
ERROR) is returned.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -5122,7 +5122,7 @@ interface of the same name.
2.8.11 sigtimedwait
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigtimedwait(const sigset_t *set, struct siginfo *info,
@@ -5148,12 +5148,12 @@ for si_code are defined in signal.h:
SI_USER. Signal sent from kill, raise, or abort
SI_QUEUE. Signal sent from sigqueue
SI_TIMER. Signal is result of timer expiration
- SI_ASYNCIO. Signal is the result of asynchronous IO completion
+ SI_ASYNCIO. Signal is the result of asynchronous IO completion
SI_MESGQ. Signal generated by arrival of a message on an empty message queue.
-Input Parameters:
+Input Parameters:
set. The set of pending signals to wait for.
info. The returned signal values
@@ -5161,14 +5161,14 @@ for si_code are defined in signal.h:
-Returned Value:
+Returned Value:
- Signal number that cause the wait to be terminated, otherwise
-1 (
ERROR) is returned.
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -5188,7 +5188,7 @@ the unblocked signal is ignored.
2.8.12 sigqueue
-Function Prototype:
+Function Prototype:
#include <signal.h>
int sigqueue (int tid, int signo, union sigval value);
@@ -5206,7 +5206,7 @@ POSIX which states: "If a subsequent occurrence of a pending signal
is generated, it is implementation defined as to whether the signal
is delivered more than once."
-Input Parameters:
+Input Parameters:
tid. ID of the task to receive signal
signo. Signal number
@@ -5214,7 +5214,7 @@ is delivered more than once."
-Returned Value:
+Returned Value:
-
On success (at least one signal was sent), zero (
OK) is returned.
@@ -5228,7 +5228,7 @@ is delivered more than once."
-Assumptions/Limitations:
+Assumptions/Limitations:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
@@ -5245,7 +5245,7 @@ be sent.
2.8.13 kill
-Function Prototype:
+Function Prototype:
#include <sys/types.h>
#include <signal.h>
@@ -5253,7 +5253,7 @@ be sent.
-Description:
+Description:
The kill() system call can be used to send any signal to
any task.
@@ -5266,7 +5266,7 @@ be sent.
is delivered more than once."
-Input Parameters:
+Input Parameters:
pid. The id of the task to receive the signal.
The POSIX kill() specification encodes process group
@@ -5278,14 +5278,14 @@ be sent.
- Returned Value:
+ Returned Value:
- OK or ERROR
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -5301,29 +5301,29 @@ be sent.
2.8.14 pause
-Function Prototype:
+Function Prototype:
#include <unistd.h>
int pause(void);
-Description:
+Description:
The pause() function will suspend the calling thread until delivery of a non-blocked signal.
-Input Parameters:
+Input Parameters:
- None
- Returned Value:
+ Returned Value:
Since pause() suspends thread execution indefinitely unless interrupted a signal, there is no successful completion return value.
A value of -1 (ERROR will always be returned and errno set to indicate the error (EINTR).
- Assumptions/Limitations:
+ Assumptions/Limitations:
POSIX Compatibility:
@@ -5405,7 +5405,7 @@ be sent.
- 2.9.28 pthread_mutexattr_getpshared
- 2.9.29 pthread_mutexattr_setpshared
- 2.9.30 pthread_mutexattr_gettype
- - 2.9.31 pthread_mutexattr_settype
+ - 2.9.31 pthread_mutexattr_settype
- 2.9.32 pthread_mutex_init
- 2.9.33 pthread_mutex_destroy
- 2.9.34 pthread_mutex_lock
@@ -6004,7 +6004,7 @@ cancellation state is set to PTHREAD_CANCEL_ENABLE.
Input Parameters:
-state
+state
New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.<.li>
oldstate.
Location to return the previous cancellation state.
@@ -6164,7 +6164,7 @@ interface of the same name.
Description:
- The pthread_getschedparam() functions will get the
+ The pthread_getschedparam() functions will get the
scheduling policy and parameters of threads.
For SCHED_FIFO and SCHED_RR, the only
required member of the sched_param structure is the
@@ -7321,7 +7321,7 @@ interface of the same name.
Description:
The pthread_barrier_init() function allocates any resources required to
use the barrier referenced by barrier and initialized the barrier with
- the attributes referenced by attr.
+ the attributes referenced by attr.
If attr is NULL, the default barrier attributes will be used.
The results are undefined if pthread_barrier_init() is called when any
thread is blocked on the barrier.
@@ -7444,7 +7444,7 @@ interface of the same name.
recent pthread_barrier_init() function that referenced it.
- The constant PTHREAD_BARRIER_SERIAL_THREAD is defined in
+ The constant PTHREAD_BARRIER_SERIAL_THREAD is defined in
pthread.h and its value must be distinct from any other value
returned by pthread_barrier_wait().
@@ -7879,7 +7879,7 @@ interface of the same name.
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
driver nodes in the any
pseudo file system directory.
(By convention, however, all driver nodes should be in the /dev
@@ -7937,8 +7937,8 @@ interface of the same name.
#include <unistd.h>
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);
#include <unistd.h>
-int pipe(int filedes[2]);
+int pipe(int fd[2]);
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.
Input Parameters:
- filedes[2]. The user provided array in which to catch the pipe file descriptors.
+ fd[2]. The user provided array in which to catch the pipe file descriptors.
@@ -8266,7 +8266,7 @@ int mkfifo(FAR const char *pathname, mode_t mode);
mkfifo() makes a FIFO device driver file with name pathname.
Unlike Linux, a NuttX FIFO is not a special file type but simply a device driver instance.
- mode specifies the FIFO's permissions (but is ignored in the current implementation).
+ mode specifies the FIFO's permissions (but is ignored in the current implementation).
Once the FIFO has been created by mkfifo(), any thread can open it for
@@ -8316,7 +8316,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
device specified by pathname
Assumptions: The caller must assure that the block driver is not mounted and not in
- use when this function is called.
+ use when this function is called.
The result of formatting a mounted device is indeterminate (but likely not good).
@@ -8363,7 +8363,7 @@ struct fat_format_s
NULL block driver string, bad number of FATS in fmt,
bad FAT size in fmt, bad cluster size in fmt
- ENOENT -
+ ENOENT -
pathname does not refer to anything in the file-system.
ENOTBLK -
@@ -8387,7 +8387,7 @@ struct fat_format_s
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.
- mmap() support is therefore required to support NXFLAT.
+ mmap() support is therefore required to support NXFLAT.
There are two conditions where mmap() can be supported:
@@ -8618,7 +8618,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags, int fd, off_
ENOSYS -
Returned if any of the unsupported mmap() features are attempted.
- EBADF -
+ EBADF -
fd is not a valid file descriptor.
EINVAL -
@@ -8862,7 +8862,7 @@ int listen(int sockfd, int backlog);
ENOTSOCK: The argument sockfd is not a socket.
EOPNOTSUPP: The socket is not of a type that supports the listen operation.
-
+
2.12.5 accept
Function Prototype: