From 4441b456d69d6b7a97c1866f602f1af638e4fbb6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Mar 2007 16:00:57 +0000 Subject: [PATCH] Update mq_send() and mq_receive() description git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@165 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttX.html | 2 + Documentation/NuttxUserGuide.html | 652 ++++++++++++++++-------------- 2 files changed, 352 insertions(+), 302 deletions(-) diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 49e51c1919..087fd48a7b 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -452,6 +452,8 @@ Other memory: 0.2.3 2007-xx-xx Gregory Nutt + * mq_receive and mq_send now return errno's appropriately + * mq_receive and mq_send are now correctly awakened by signals. * Started m68322 diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index d13addea17..d706c60c62 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -1,9 +1,9 @@ - + - -NuttX Users Manual - - + +NuttX Users Manual + +
@@ -11,18 +11,18 @@

Under Construction



-
+
NuttX Operating System

User's Manual

-by +by

Gregory Nutt

-Last Update: March 26, 2007 -

+Last Update: March 28, 2007 +

1.0 Introduction

@@ -166,10 +166,10 @@ paragraphs.

Function Prototype: -

+
    #include <sched.h>
    int task_create(char *name, int priority, int stack_size, main_t entry, const char *argv[]);
-
+

Description: @@ -234,11 +234,11 @@ paragraphs.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: -

+
    int taskSpawn(char *name, int priority, int options, int stackSize, FUNCPTR entryPt,
                  int arg1, int arg2, int arg3, int arg4, int arg5,
                  int arg6, int arg7, int arg8, int arg9, int arg10);
-
+

The NuttX task_create() differs from VxWorks' taskSpawn() in the @@ -255,11 +255,11 @@ VxWorks provides the following similar interface:

Function Prototype: -

+
    #include <sched.h>
    STATUS task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
                     maint_t entry, const char *argv[]);
-
+

Description: @@ -306,11 +306,11 @@ mechanism to initialize and start a new task.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: -

+
    STATUS taskInit(WIND_TCB *pTcb, char *name, int priority, int options, uint32 *pStackBase, int stackSize,
                    FUNCPTR entryPt, int arg1, int arg2, int arg3, int arg4, int arg5,
                    int arg6, int arg7, int arg8, int arg9, int arg10);
-
+

The NuttX task_init() differs from VxWorks' taskInit() in the @@ -327,10 +327,10 @@ VxWorks provides the following similar interface:

Function Prototype: -

+
     #include <sched.h>
     STATUS task_activate( _TCB *tcb );
-
+

Description: This function activates tasks created by task_init(). @@ -359,9 +359,9 @@ mechanism to initialize and start a new task.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: -

+
     STATUS taskActivate( int tid );
-
+

The NuttX task_activate() differs from VxWorks' taskActivate() in the @@ -377,10 +377,10 @@ the pointer to the WIND_TCB cast to an integer.

Function Prototype: -

+
     #include <sched.h>
     STATUS task_delete( pid_t pid );
-
+

Description: This function causes a specified task to cease @@ -409,9 +409,9 @@ task_delete() can strand those resources.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: -

+
     STATUS taskDelete( int tid );
-
+

The NuttX task_delete() differs from VxWorks' taskDelete() in @@ -427,13 +427,13 @@ VxWorks provides the following similar interface:

Function Prototype: -

+
     #include <sched.h>
     void exit( int code );
 
     #include <nuttx/unistd.h>
     void _exit( int code );
-
+

Description: This function causes the calling task to cease @@ -454,13 +454,13 @@ execute any function registered with atexit().

POSIX Compatibility: This is equivalent to the ANSI interface: -

+
     void exit( int code );
-
+
And the unix interface: -
+
     void _exit( int code );
-
+

The NuttX exit() differs from ANSI exit() in the following ways: @@ -473,10 +473,10 @@ And the unix interface:

Function Prototype: -

+
     #include <sched.h>
     STATUS task_restart( pid_t pid );
-
+

Description: This function "restarts" a task. @@ -507,9 +507,9 @@ zero signifies the calling task.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface: -

+
     STATUS taskRestart (int tid);
-
+

The NuttX task_restart() differs from VxWorks' taskRestart() in the following ways: @@ -524,10 +524,10 @@ the value that they had when the task was terminated.

Function Prototype: -

+
     #include <unistd.h>
     pid_t getpid( void );
-
+

Description: This function returns the task ID of the @@ -644,10 +644,10 @@ Compatible with the POSIX interface of the same name.

Function Prototype: -

+
     #include <sched.h>
     int sched_getparam (pid_t pid, struct sched_param *param);
-
+

Description: This function gets the scheduling priority @@ -681,10 +681,10 @@ interface of the same name.

2.2.3 sched_setscheduler

Function Prototype: -

+
     #include <sched.h>
     int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
-
+

Description: sched_setscheduler() sets both the scheduling policy @@ -729,10 +729,10 @@ interface of the same name.

2.2.4 sched_getscheduler

Function Prototype: -

+
     #include <sched.h>
     int sched_getscheduler (pid_t pid);
-
+

Description: sched_getscheduler() returns the scheduling policy @@ -780,10 +780,10 @@ Differences from the full POSIX implementation include:

Function Prototype: -

+
     #include <sched.h>
     int sched_yield( void );
-
+

Description: This function forces the calling task to give @@ -806,10 +806,10 @@ interface of the same name.

Function Prototype: -

+
     #include <sched.h>
     int sched_get_priority_max (int policy)
-
+

Description: This function returns the value of the highest @@ -836,10 +836,10 @@ interface of the same name.

Function Prototype: -

+
     #include <sched.h>
     int sched_get_priority_min (int policy);
-
+

Description: This function returns the value of the lowest @@ -866,10 +866,10 @@ interface of the same name.

Function Prototype: -

+
     #include <sched.h>
     int sched_get_rr_interval (pid_t pid, struct timespec *interval);
-
+

Description: @@ -920,10 +920,10 @@ priority of the calling task is returned.

Function Prototype: -

+
     #include <sched.h>
     STATUS sched_lock( void );
-
+

Description: This function disables context switching by @@ -944,18 +944,18 @@ number of times) or until it blocks itself.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the comparable interface: -

+
     STATUS taskLock( void );
-
+

2.3.2 sched_unlock

Function Prototype: -

+
     #include <sched.h>
     STATUS sched_unlock( void );
-
+

Description: This function decrements the preemption lock @@ -977,18 +977,18 @@ eligible to preempt the current task will execute.

POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the comparable interface: -

+
     STATUS taskUnlock( void );
-
+

2.3.3 sched_lockcount

Function Prototype: -

+
     #include <sched.h>
     sint32 sched_lockcount( void )
-
+

Description: This function returns the current value of @@ -1031,10 +1031,10 @@ on this thread of execution.

Function Prototype: -

+
     #include <mqueue.h>
     mqd_t mq_open( const char *mqName, int oflags, ... );
-
+

Description: This function establish a connection between @@ -1100,10 +1100,10 @@ message size is limited at 22 bytes.

Function Prototype: -

+
     #include <mqueue.h>
     int mq_close( mqd_t mqdes );
-
+

Description: This function is used to indicate that the @@ -1132,8 +1132,8 @@ for notification. Assumptions/Limitations:

    -
  • The behavior of a task that is blocked on either a mq_send() or -mq_receive() is undefined when mq_close() is called. +
  • The behavior of a task that is blocked on either a mq_send() or +mq_receive() is undefined when mq_close() is called.
  • The result of using this message queue descriptor after successful return from mq_close() is undefined.
@@ -1145,10 +1145,10 @@ of the same name.

Function Prototype: -

+
     #include <mqueue.h>
     int mq_unlink( const char *mqName );
-
+

Description: This function removes the message queue named @@ -1174,109 +1174,156 @@ interface of the same name.

Function Prototype: -

+

+
     #include <mqueue.h>
-    int mq_send( mqd_t mqdes, const void *msg, size_t msgLen, int msgPrio );
-
- + int mq_send(mqd_t mqdes, const void *msg, size_t msglen, int prio); +

-Description: This function adds the specified message (msg) -to the message queue (mqdes). The "msgLen" parameter -specifies the length of the message in bytes pointed to by "msg." -This length must not exceed the maximum message length from the -mq_getattr(). +Description: + This function adds the specified message, msg, + to the message queue, mqdes. + The msglen parameter specifies the length of the message in bytes pointed to by msg. + This length must not exceed the maximum message length from the mq_getattr(). +

-If the message queue is not full, mq_send() will in the message -in the message queue at the position indicated by the "msgPrio" -argument. Messages with higher priority will be inserted before -lower priority messages. The value of "msgPrio" must -not exceed MQ_PRIO_MAX. + If the message queue is not full, mq_send() will place the msg + in the message queue at the position indicated by the prio argument. + Messages with higher priority will be inserted before lower priority messages + The value of prio must not exceed MQ_PRIO_MAX. +

-If the specified message queue is full and O_NONBLOCK is not -set in the message queue, then mq_send() will block until space -becomes available to the queue the message. + If the specified message queue is full and O_NONBLOCK is not + set in the message queue, then mq_send() will block until space + becomes available to the queue the message. +

-If the message queue is full and osNON_BLOCK is set, the message -is not queued and ERROR is returned. + If the message queue is full and NON_BLOCK is set, the message + is not queued and ERROR is returned. +

-Input Parameters: + Input Parameters: +

    -
  • mqdes. Message queue descriptor -
  • msg. Message to send -
  • msgLen. The length of the message in bytes -
  • msgPrio. The priority of the message +
  • mqdes. Message queue descriptor.
  • +
  • msg. Message to send.
  • +
  • msglen. The length of the message in bytes.
  • +
  • prio. The priority of the message.
-

-Returned Values: None. -

-Assumptions/Limitations: -

- POSIX Compatibility: Comparable to the POSIX -interface of the same name. -Differences from the full POSIX implementation include: + Returned Values: + On success, mq_send() returns 0 (OK); + on error, -1 (ERROR) is returned, with errno set + to indicate the error: +

    -
  • Control is not returned if a signal is received. +
  • + EAGAIN. + The queue was empty, and the O_NONBLOCK flag was set for the message queue description referred to by mqdes. +
  • +
  • + EINVAL. + Either msg or mqdes is NULL or the value of prio is invalid. +
  • +
  • + EPERM. + Message queue opened not opened for writing. +
  • +
  • + EMSGSIZE. + msglen was greater than the maxmsgsize attribute of the message queue. +
  • +
  • + EINTR. + The call was interrupted by a signal handler. +
- -

2.4.5 mq_receive

-

-Function Prototype: -

+  Assumptions/Limitations: 
+

+

+ POSIX Compatibility: + Comparable to the POSIX interface of the same name. +

+ +

2.4.5 mq_receive

+

+ Function Prototype: +

+
     #include <mqueue.h>
-    int mq_receive( mqd_t mqdes, void *msg, size_t msgLen, int *msgPrio );
-
- + int mq_receive(mqd_t mqdes, void *msg, size_t msglen, int *prio); +

-Description: This function receives the oldest of the highest -priority messages from the message queue specified by "mqdes." -If the size of the buffer in bytes (msgLen) is less than the "mq_msgsize" -attribute of the message queue, mq_receive will return an error. -Otherwise, the select message is removed from the queue and copied -to "msg." + Description: + This function receives the oldest of the highest priority messages from the message + queue specified by mqdes. + If the size of the buffer in bytes, msgLen, is less than the + mq_msgsize attribute of the message queue, mq_receive() will + return an error. + Otherwise, the selected message is removed from the queue and copied to msg. +

-If the message queue is empty and O_NONBLOCK was not set, mq_receive() -will block until a message is added to the message queue. If more -than one task is waiting to receive a message, only the task with -the highest priority that has waited the longest will be unblocked. + If the message queue is empty and O_NONBLOCK was not set, mq_receive() + will block until a message is added to the message queue. + If more than one task is waiting to receive a message, only the task with the highest + priority that has waited the longest will be unblocked. +

-If the queue is empty and O_NONBLOCK is set, ERROR will be -returned. + If the queue is empty and O_NONBLOCK is set, ERROR will be returned. +

-Input Parameters: + Input Parameters: +

    -
  • mqdes. Message Queue Descriptor -
  • msg. Buffer to receive the message -
  • msgLen. Size of the buffer in bytes -
  • msgPrio. If not NULL, the location to store message -priority. +
  • mqdes. Message Queue Descriptor.
  • +
  • msg. Buffer to receive the message.
  • +
  • msglen. Size of the buffer in bytes.
  • +
  • prio. If not NULL, the location to store message priority.
-

-Returned Values: + Returned Values:. + One success, the length of the selected message in bytes is returned. + On failure, -1 (ERROR) is returned and the errno is set appropriately: +

    -
  • Length of the selected message in bytes, otherwise -1 (ERROR). +
  • + EAGAIN + The queue was empty and the O_NONBLOCK flag was set for the message queue description referred to by mqdes. +
  • +
  • + EPERM + Message queue opened not opened for reading. +
  • +
  • + EMSGSIZE + msglen was less than the maxmsgsize attribute of the message queue. +
  • +
  • + EINTR + The call was interrupted by a signal handler. +
  • +
  • + EINVAL + Invalid msg or mqdes +
-

-Assumptions/Limitations: + Assumptions/Limitations: +

- POSIX Compatibility: Comparable to the POSIX -interface of the same name. -Differences from the full POSIX implementation include: -

    -
  • Control is not returned if a signal is received. -
+ POSIX Compatibility: + Comparable to the POSIX interface of the same name. +

2.4.6 mq_notify

Function Prototype: -

+
     #include <mqueue.h>
-    int mq_notify( mqd_t mqdes, const struct sigevent *notification );
-
+ int mq_notify(mqd_t mqdes, const struct sigevent *notification); +

Description: If the "notification" input parameter @@ -1329,11 +1376,11 @@ message queue remains empty, and no notification shall be sent."

Function Prototype: -

+
     #include <mqueue.h>
     int mq_setattr( mqd_t mqdes, const struct mq_attr *mqStat,
                      struct mq_attr *oldMqStat);
-
+

Description: This function sets the attributes associated @@ -1368,10 +1415,10 @@ interface of the same name.

Function Prototype: -

+
     #include <mqueue.h>
     int mq_getattr( mqd_t mqdes, struct mq_attr *mqStat);
-
+

Description: This functions gets status information and @@ -1473,10 +1520,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_init ( sem_t *sem, int pshared, unsigned int value );
-
+

Description: This function initializes the UN-NAMED semaphore @@ -1516,10 +1563,10 @@ Differences from the full POSIX implementation include:

Function Prototype: -

+
     #include <semaphore.h>
     int sem_destroy ( sem_t *sem );
-
+

Description: This function is used to destroy the un-named semaphore @@ -1553,10 +1600,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     sem_t *sem_open ( const char *name, int oflag, ...);
-
+

Description: This function establishes a connection between @@ -1619,10 +1666,10 @@ just a counting semaphore.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_close ( sem_t *sem );
-
+

Description: This function is called to indicate that the @@ -1664,10 +1711,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_unlink ( const char *name );
-
+

Description: This function will remove the semaphore named by the @@ -1710,10 +1757,10 @@ same name should be created after sem_unlink() is called.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_wait ( sem_t *sem );
-
+

Description: This function attempts to lock the semaphore @@ -1753,10 +1800,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_trywait ( sem_t *sem );
-
+

Description: This function locks the specified semaphore @@ -1795,10 +1842,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_post ( sem_t *sem );
-
+

Description: When a task has finished with a semaphore, @@ -1838,10 +1885,10 @@ interface of the same name.

Function Prototype: -

+
     #include <semaphore.h>
     int sem_getvalue ( sem_t *sem, int *sval );
-
+

Description: This function updates the location referenced @@ -1883,7 +1930,8 @@ interface of the same name. that will run after a specified delay. The watchdog timer function will run in the context of the timer interrupt handler. Because of this, a limited number of NuttX interfaces are available to he watchdog timer function. - However, the watchdog timer function may use mq_send(), sigqueue(), or kill() to communicate with NuttX tasks. + However, the watchdog timer function may use mq_send(), sigqueue(), + or kill() to communicate with NuttX tasks.

  • 2.6.1 wd_create
  • @@ -1897,10 +1945,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <wdog.h>
         WDOG_ID wd_create (void);
    -
    +

    Description: The wd_create function will create a watchdog @@ -1920,9 +1968,9 @@ are available to create the watchdogs.

    POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following comparable interface: -

    +
         WDOG_ID wdCreate (void);
    -
    +

    Differences from the VxWorks interface include: @@ -1935,10 +1983,10 @@ initialization time).

    Function Prototype: -

    +
         #include <wdog.h>
         STATUS wd_delete (WDOG_ID wdog);
    -
    +

    Description: The wd_delete function will deallocate a @@ -1964,9 +2012,9 @@ it.

    POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following comparable interface: -

    +
         STATUS wdDelete (WDOG_ID wdog);
    -
    +

    Differences from the VxWorks interface include: @@ -1979,11 +2027,11 @@ before de-allocating it (i.e., never returns ERROR).

    Function Prototype: -

    +
         #include <wdog.h>
         STATUS wd_start( WDOG_ID wdog, int delay, wdentry_t wdentry,
                          intt argc, ....);
    -
    +

    Description: This function adds a watchdog to the timer @@ -2023,9 +2071,9 @@ restrictions.

    POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following comparable interface: -

    +
         STATUS wdStart (WDOG_ID wdog, int delay, FUNCPTR wdentry, int parameter);
    -
    +

    Differences from the VxWorks interface include: @@ -2038,10 +2086,10 @@ number of parameters is determined by

    2.6.4 wd_cancel

    Function Prototype: -

    +
         #include <wdog.h>
         STATUS wd_cancel (WDOG_ID wdog);
    -
    +

    Description: This function cancels a currently running @@ -2064,9 +2112,9 @@ level.

    POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following comparable interface: -

    +
         STATUS wdCancel (WDOG_ID wdog);
    -
    +

    2.6.5 wd_gettime

    @@ -2599,10 +2647,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigemptyset(sigset_t *set);
    -
    +

    Description: This function initializes the signal set specified @@ -2629,10 +2677,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigfillset(sigset_t *set);
    -
    +

    Description: This function initializes the signal set specified @@ -2659,10 +2707,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigaddset(sigset_t *set, int signo);
    -
    +

    Description: This function adds the signal specified by @@ -2690,10 +2738,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigdelset(sigset_t *set, int signo);
    -
    +

    Description: This function deletes the signal specified @@ -2721,10 +2769,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int  sigismember(const sigset_t *set, int signo);
    -
    +

    Description: This function tests whether the signal specified @@ -2754,11 +2802,11 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigaction( int signo, const struct sigaction *act,
                        struct sigaction *oact );
    -
    +

    Description: This function allows the calling task to @@ -2827,10 +2875,10 @@ not handled (SIG_DFL, SIG_IGN).

    Function Prototype: -

    +
         #include <signal.h>
         int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
    -
    +

    Description: This function allows the calling task to @@ -2877,10 +2925,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigpending( sigset_t *set );
    -
    +

    Description: This function stores the returns the set of @@ -2915,10 +2963,10 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigsuspend( const sigset_t *set );
    -
    +

    Description: The sigsuspend() function replaces the signal mask @@ -2963,10 +3011,10 @@ is required in the present implementation (even if the signal is ignored).

    Function Prototype: -

    +
         #include <signal.h>
         int sigwaitinfo(const sigset_t *set, struct siginfo *info);
    -
    +

    Description: This function is equivalent to sigtimedwait() @@ -2995,11 +3043,11 @@ interface of the same name.

    Function Prototype: -

    +
         #include <signal.h>
         int sigtimedwait( const sigset_t *set, struct siginfo *info,
                           const struct timespec *timeout );
    -
    +

    Description: This function selects the pending signal set @@ -3061,10 +3109,10 @@ the unblocked signal is ignored.

    Function Prototype: -

    +
         #include <signal.h>
         int sigqueue (int tid, int signo, const union sigval value);
    -
    +

    Description: This function sends the signal specified by @@ -3118,11 +3166,11 @@ be sent.

    Function Prototype: -

    +
        #include <sys/types.h>
        #include <signal.h>
        int kill(pid_t pid, int sig);
    -
    +

    Description: @@ -3298,10 +3346,10 @@ be sent.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_attr_init(pthread_attr_t *attr);
    -
    +

    Description: Initializes a thread attributes object (attr) with default values @@ -3331,10 +3379,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_attr_destroy(pthread_attr_t *attr);
    -
    +

    Description: An attributes object can be deleted when it is no longer needed. @@ -3363,10 +3411,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
    -
    +

    Description:

    @@ -3394,10 +3442,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
    -
    +

    Description:

    @@ -3425,11 +3473,11 @@ interface of the same name.

    Function Prototype:

    -

    +
        #include <pthread.h>
         int pthread_attr_setschedparam(pthread_attr_t *attr,
     				      const struct sched_param *param);
    -
    +

    Description:

    @@ -3457,11 +3505,11 @@ interface of the same name.

    Function Prototype:

    -

    +
        #include <pthread.h>
          int pthread_attr_getschedparam(pthread_attr_t *attr,
     				      struct sched_param *param);
    -
    +

    Description:

    @@ -3489,11 +3537,11 @@ interface of the same name.

    Function Prototype:

    -

    +
        #include <pthread.h>
         int pthread_attr_setinheritsched(pthread_attr_t *attr,
     					int inheritsched);
    -
    +

    Description:

    @@ -3521,11 +3569,11 @@ interface of the same name.

    Function Prototype:

    -

    +
        #include <pthread.h>
          int pthread_attr_getinheritsched(const pthread_attr_t *attr,
     					int *inheritsched);
    -
    +

    Description:

    @@ -3553,10 +3601,10 @@ interface of the same name.

    Function Prototype:

    -

    +
        #include <pthread.h>
         int pthread_attr_setstacksize(pthread_attr_t *attr, long stacksize);
    -
    +

    Description:

    @@ -3584,10 +3632,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
        int pthread_attr_getstacksize(pthread_attr_t *attr, long *stackaddr);
    -
    +

    Description:

    @@ -3615,12 +3663,12 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_create(pthread_t *thread, pthread_attr_t *attr,
     			  pthread_startroutine_t startRoutine,
     			  pthread_addr_t arg);
    -
    +

    Description: To create a thread object and runnable thread, a routine @@ -3654,10 +3702,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_detach(pthread_t thread);
    -
    +

    Description: A thread object may be "detached" to specify that the @@ -3687,10 +3735,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         void pthread_exit(pthread_addr_t pvValue);
    -
    +

    Description: A thread may terminate it's own execution. @@ -3719,10 +3767,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cancel(pthread_t thread);
    -
    +

    Description: @@ -3775,10 +3823,10 @@ the time when cancelation is re-enabled.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_setcancelstate(int state, int *oldstate);
    -
    +

    Description:

    The pthread_setcancelstate() function atomically @@ -3817,10 +3865,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_setcancelstate(void);
    -
    +

    Description:

    NOT SUPPORTED @@ -3848,10 +3896,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_join(pthread_t thread, pthread_addr_t *ppvValue);
    -
    +

    Description: A thread can await termination of another thread and retrieve @@ -3881,10 +3929,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         void pthread_yield(void);
    -
    +

    Description: A thread may tell the scheduler that its processor can be @@ -3914,10 +3962,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         pthread_t pthread_self(void);
    -
    +

    Description: A thread may obtain a copy of its own thread handle. @@ -4104,10 +4152,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_key_create( pthread_key_t *key, void (*destructor)(void*) )
    -
    +

    Description:

    @@ -4159,10 +4207,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_setspecific( pthread_key_t key, void *value )
    -
    +

    Description:

    @@ -4209,10 +4257,10 @@ destructor function.

    Function Prototype:

    -

    +
         #include <pthread.h>
         void *pthread_getspecific( pthread_key_t key )
    -
    +

    Description:

    @@ -4250,10 +4298,10 @@ destructor function.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_key_delete( pthread_key_t key )
    -
    +

    Description:

    @@ -4282,10 +4330,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutexattr_init(pthread_mutexattr_t *attr);
    -
    +

    Description:

    @@ -4313,10 +4361,10 @@ interface of the same name.

    Function Protoype:

    -

    +
         #include <pthread.h>
         int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
    -
    +

    Description:

    @@ -4344,11 +4392,11 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr,
     					int *pshared);
    -
    +

    Description:

    @@ -4376,11 +4424,11 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
        int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
     					int pshared);
    -
    +

    Description:

    @@ -4408,11 +4456,11 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutex_init(pthread_mutex_t *mutex,
     			      pthread_mutexattr_t *attr);
    -
    +

    Description:

    @@ -4440,10 +4488,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutex_destroy(pthread_mutex_t *mutex);
    -
    +

    Description:

    @@ -4471,10 +4519,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutex_lock(pthread_mutex_t *mutex);
    -
    +

    Description:

    @@ -4502,10 +4550,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutex_trylock(pthread_mutex_t *mutex);
    -
    +

    Description:

    @@ -4533,10 +4581,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_mutex_unlock(pthread_mutex_t *mutex);
    -
    +

    Description:

    @@ -4564,10 +4612,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_condattr_init(pthread_condattr_t *attr);
    -
    +

    Description:

    @@ -4595,10 +4643,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_condattr_destroy(pthread_condattr_t *attr);
    -
    +

    Description:

    @@ -4626,10 +4674,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *attr);
    -
    +

    Description:

    @@ -4657,10 +4705,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cond_destroy(pthread_cond_t *cond);
    -
    +

    Description:

    @@ -4688,10 +4736,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cond_broadcast(pthread_cond_t *cond);
    -
    +

    Description:

    @@ -4719,10 +4767,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cond_signal(pthread_cond_t *dond);
    -
    +

    Description:

    @@ -4750,10 +4798,10 @@ interface of the same name.

    Function Prototype:

    -

    +
         #include <pthread.h>
         int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
    -
    +

    Description:

    @@ -5328,7 +5376,7 @@ function call:

    Function Prototype:

    -

        int *get_errno_ptr( void )
    +
        int *get_errno_ptr( void )

    Description: osGetErrnorPtr() returns a pointer to the thread-specific errno value. @@ -5352,54 +5400,54 @@ between pthreads.

    main_t defines the type of a task entry point. main_t is declared in sys/types.h as: -

    +
         typedef int (*main_t)(int argc, char *argv[]);
    -
    +

    3.4.2 struct sched_param

    This structure is used to pass scheduling priorities to and from NuttX; -

    +
         struct sched_param
         {
           int sched_priority;
         };
    -
    +

    3.4.3 struct timespec

    This structure is used to pass timing information between the NuttX and a user application: -

    +
         struct timespec
         {
           time_t tv_sec;  /* Seconds */
           long   tv_nsec; /* Nanoseconds */
         };
    -
    +

    3.4.4 struct mq_attr

    This structure is used to communicate message queue attributes between NuttX and a MoBY application: -

    +
         struct mq_attr {
           size_t       mq_maxmsg;   /* Max number of messages in queue */
           size_t       mq_msgsize;  /* Max message size */
           unsigned     mq_flags;    /* Queue flags */
           size_t       mq_curmsgs;  /* Number of messages currently in queue */
         };
    -
    +

    3.4.5 struct sigaction

    The following structure defines the action to take for given signal: -

    +
         struct sigaction
         {
           union
    @@ -5412,48 +5460,48 @@ The following structure defines the action to take for given signal:
         };
         #define sa_handler   sa_u._sa_handler
         #define sa_sigaction sa_u._sa_sigaction
    -
    +

    3.4.6 struct siginfo/siginfo_t

    The following types is used to pass parameters to/from signal handlers: -

    +
         typedef struct siginfo
         {
           int          si_signo;
           int          si_code;
           union sigval si_value;
        } siginfo_t;
    -
    +

    3.4.7 union sigval

    This defines the type of the struct siginfo si_value field and is used to pass parameters with signals. -

    +
         union sigval
         {
           int   sival_int;
           void *sival_ptr;
         };
    -
    +

    3.4.8 struct sigevent

    The following is used to attach a signal to a message queue to notify a task when a message is available on a queue. -

    +
         struct sigevent
         {
           int          sigev_signo;
           union sigval sigev_value;
           int          sigev_notify;
         };
    -
    +

    3.4.9 Watchdog Data Types