diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 4a98bf50e49..df71ef5c54a 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

NuttX Operating System

User's Manual

by

Gregory Nutt

-

Last Updated: December 10, 2016

+

Last Updated: December 11, 2016

@@ -3533,6 +3533,8 @@ interface of the same name.
  • 2.5.8 sem_trywait
  • 2.5.9 sem_post
  • 2.5.10 sem_getvalue
  • +
  • 2.5.11 sem_getprotocol
  • +
  • 2.5.12 sem_setprotocol
  • 2.5.1 sem_init

    @@ -4007,6 +4009,74 @@ number of tasks waiting for the semaphore. interface of the same name.

    +

    2.5.11 sem_getprotocol

    +

    +Function Prototype: +

    +

    +    #include <nuttx/semaphore.h>
    +    int sem_getprotocol(FAR const pthread_mutexattr_t *attr, FAR int *protocol);
    +
    +

    +Description: Return the value of the semaphore protocol attribute. +

    +

    +Input Parameters: +

    +

    +

    +

    +

    +Returned Value: +

    +

    +If successful, the sem_getprotocol() function will return zero (OK). +Otherwise, an -1 (ERROR) will be returned and the errno value will be set to indicate the nature of the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Non-standard NuttX interface. Should not be used in portable code. Analogous to pthread_muxtexattr_getprotocol(). +

    + +

    2.5.12 sem_setprotocol

    +

    +Function Prototype: +

    +

    +    #include <nuttx/semaphore.h>
    +    int sem_setprotocol(FAR pthread_mutexattr_t *attr, int protocol);
    +
    +

    +Description: Set semaphore protocol attribute. +

    +

    +Input Parameters: +

    +

    +

    +

    +

    +Returned Value: +

    +

    +If successful, the sem_getprotocol() function will return zero (OK). +Otherwise, an -1 (ERROR) will be returned and the errno value will be set to indicate the nature of the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Non-standard NuttX interface. Should not be used in portable code. Analogous to pthread_muxtexattr_setprotocol(). +

    + - +
    @@ -5596,49 +5666,51 @@ be sent.
  • 2.8.32 pthread_mutexattr_setpshared
  • 2.8.33 pthread_mutexattr_gettype
  • 2.8.34 pthread_mutexattr_settype
  • -
  • 2.8.35 pthread_mutex_init
  • -
  • 2.8.36 pthread_mutex_destroy
  • -
  • 2.8.37 pthread_mutex_lock
  • -
  • 2.8.38 pthread_mutex_trylock
  • -
  • 2.8.39 pthread_mutex_unlock
  • +
  • 2.8.35 pthread_mutexattr_getprotocol
  • +
  • 2.8.36 pthread_mutexattr_setprotocol
  • +
  • 2.8.37 pthread_mutex_init
  • +
  • 2.8.38 pthread_mutex_destroy
  • +
  • 2.8.39 pthread_mutex_lock
  • +
  • 2.8.40 pthread_mutex_trylock
  • +
  • 2.8.41 pthread_mutex_unlock
  • Condition Variables.

    Barriers.

    Initialization.

    Signals.

    @@ -7021,7 +7093,77 @@ returned to indicate the error:

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

    2.8.35 pthread_mutex_init

    +

    2.8.35 pthread_mutexattr_getprotocol

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    int pthread_mutexattr_getprotocol(FAR const pthread_mutexattr_t *attr,
    +                                      FAR int *protocol);
    +
    +

    +Description: Return the value of the mutex protocol attribute.. +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the mutex attributes to be queried
    • +
    • protocol. The user provided location in which to store the protocol value. May be one of PTHREAD_PRIO_NONE, or PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the pthread_mutexattr_setprotocol() function will return zero (OK). +Otherwise, an error number will be returned to indicate the error. +

    +

    +Assumptions/Limitations: +

    +

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

    + +

    2.8.36 pthread_mutexattr_setprotocol

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr,
    +                                      int protocol);
    +
    +

    +Description: Set mutex protocol attribute. +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the mutex attributes to be modified
    • +
    • protocol. The new protocol to use. One of PTHREAD_PRIO_NONE, or PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT. PTHREAD_PRIO_INHERIT is supported only if CONFIG_PRIORITY_INHERITANCE is defined; PTHREAD_PRIO_PROTECT is not currently supported in any configuration.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the pthread_mutexattr_setprotocol() function will return zero (OK). +Otherwise, an error number will be returned to indicate the error. +

    +

    +Assumptions/Limitations: +

    +

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

    + +

    2.8.37 pthread_mutex_init

    Function Prototype:

    @@ -7050,10 +7192,9 @@ returned to indicate the error: Assumptions/Limitations:

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

    2.8.36 pthread_mutex_destroy

    +

    2.8.38 pthread_mutex_destroy

    Function Prototype:

    @@ -7084,7 +7225,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.37 pthread_mutex_lock

    +

    2.8.39 pthread_mutex_lock

    Function Prototype:

    @@ -7150,7 +7291,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.38 pthread_mutex_trylock

    +

    2.8.40 pthread_mutex_trylock

    Function Prototype:

    @@ -7190,7 +7331,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.39 pthread_mutex_unlock

    +

    2.8.41 pthread_mutex_unlock

    Function Prototype:

    @@ -7236,7 +7377,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.40 pthread_condattr_init

    +

    2.8.42 pthread_condattr_init

    Function Prototype:

    @@ -7267,7 +7408,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.41 pthread_condattr_destroy

    +

    2.8.43 pthread_condattr_destroy

    Function Prototype:

    @@ -7298,7 +7439,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.42 pthread_cond_init

    +

    2.8.44 pthread_cond_init

    Function Prototype:

    @@ -7329,7 +7470,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.43 pthread_cond_destroy

    +

    2.8.45 pthread_cond_destroy

    Function Prototype:

    @@ -7360,7 +7501,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.44 pthread_cond_broadcast

    +

    2.8.46 pthread_cond_broadcast

    Function Prototype:

    @@ -7391,7 +7532,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.45 pthread_cond_signal

    +

    2.8.47 pthread_cond_signal

    Function Prototype:

    @@ -7422,7 +7563,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.46 pthread_cond_wait

    +

    2.8.48 pthread_cond_wait

    Function Prototype:

    @@ -7453,7 +7594,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.47 pthread_cond_timedwait

    +

    2.8.49 pthread_cond_timedwait

    Function Prototype:

    @@ -7490,7 +7631,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.48 pthread_barrierattr_init

    +

    2.8.50 pthread_barrierattr_init

    Function Prototype:

    @@ -7523,7 +7664,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.49 pthread_barrierattr_destroy

    +

    2.8.51 pthread_barrierattr_destroy

    Function Prototype:

    @@ -7555,7 +7696,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.50 pthread_barrierattr_setpshared

    +

    2.8.52 pthread_barrierattr_setpshared

    Function Prototype:

    @@ -7593,7 +7734,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.51 pthread_barrierattr_getpshared

    +

    2.8.53 pthread_barrierattr_getpshared

    Function Prototype:

    @@ -7625,7 +7766,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.52 pthread_barrier_init

    +

    2.8.54 pthread_barrier_init

    Function Prototype:

    @@ -7695,7 +7836,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.53 pthread_barrier_destroy

    +

    2.8.55 pthread_barrier_destroy

    Function Prototype:

    @@ -7739,7 +7880,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.54 pthread_barrier_wait

    +

    2.8.56 pthread_barrier_wait

    Function Prototype:

    @@ -7799,7 +7940,7 @@ interface of the same name.

    -

    2.8.55 pthread_once

    +

    2.8.57 pthread_once

    Function Prototype:

    @@ -7843,7 +7984,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.56 pthread_kill

    +

    2.8.58 pthread_kill

    Function Prototype:

    @@ -7905,7 +8046,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.57 pthread_sigmask

    +

    2.8.59 pthread_sigmask

    Function Prototype:

    @@ -10237,10 +10378,10 @@ notify a task when a message is available on a queue.
  • mq_timedsend
  • mq_unlink
  • mmap
  • -
  • Network Interfaces
  • on_exit +
  • open
  • opendir
  • OS Interfaces
  • @@ -10305,9 +10446,11 @@ notify a task when a message is available on a queue.
  • pthread_key_delete
  • pthread_kill
  • pthread_mutexattr_destroy
  • +
  • pthread_mutexattr_getprotocol
  • pthread_mutexattr_getpshared
  • pthread_mutexattr_gettype
  • pthread_mutexattr_init
  • +
  • pthread_mutexattr_setprotocol
  • pthread_mutexattr_setpshared
  • pthread_mutexattr_settype
  • pthread_mutex_destroy
  • @@ -10328,9 +10471,9 @@ notify a task when a message is available on a queue.
  • puts
  • RAM disk driver
  • read
  • +
  • readdir
  • -
  • readdir
  • readdir_r
  • recv
  • recvfrom
  • @@ -10353,10 +10496,12 @@ notify a task when a message is available on a queue.
  • Counting Semaphore Interfaces
  • sem_close
  • sem_destroy
  • +
  • sem_getprotocol
  • sem_getvalue
  • sem_init
  • sem_open
  • sem_post
  • +
  • sem_setprotocol
  • sem_trywait
  • sem_unlink
  • sem_wait
  • diff --git a/libc/pthread/pthread_mutexattr_setprotocol.c b/libc/pthread/pthread_mutexattr_setprotocol.c index 0d128e0480d..44d8be78494 100644 --- a/libc/pthread/pthread_mutexattr_setprotocol.c +++ b/libc/pthread/pthread_mutexattr_setprotocol.c @@ -86,5 +86,4 @@ int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr, return ENOSYS; #endif - }