Skip to content
Snippets Groups Projects
NuttxUserGuide.html 120 KiB
Newer Older
<LI><I>wdog</I>. ID of the watchdog to cancel.
patacongo's avatar
patacongo committed
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>OK or ERROR
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
<PRE>
    STATUS wdCancel (WDOG_ID wdog);
patacongo's avatar
patacongo committed
</PRE>

<HR>

<H2>2.7 <A NAME="Signals">Signal Interfaces</A></H2>

patacongo's avatar
patacongo committed
<p>
  NuttX provides signal interfaces for tasks. Signals are used to
  alter the flow control of tasks by communicating asynchronous events
  within or between task contexts.
  Any task or interrupt handler can post (or send) a signal to a particular task.
  The task being signaled will execute task-specified signal handler
  function the next time that the task has priority.
  The signal handler is a user-supplied function that is bound to
  a specific signal and performs whatever actions are necessary
  whenever the signal is received.
</p>
<p>
  There are no predefined actions for any signal.
  The default action for all signals (i.e., when no signal handler has
  been supplied by the user) is to ignore the signal.
  In this sense, all NuttX are <i>real time</i> signals.
</p>
<p>
  Tasks may also suspend themselves and wait until a signal is received.
</p>
<p>
  The following signal handling interfaces are provided by NuttX:
</p>
<ul>
  <li><a href="#sigemptyset">2.7.1 sigemptyset</a></li>
  <li><a href="#sigfillset">2.7.2 sigfillset</a></li>
  <li><a href="#sigaddset">2.7.3 sigaddset</a></li>
  <li><a href="#sigdelset">2.7.4 sigdelset</a></li>
  <li><a href="#sigismember">2.7.5 sigismember</a></li>
  <li><a href="#sigaction">2.7.6 sigaction</a></li>
  <li><a href="#sigprocmask">2.7.7 sigprocmask</a></li>
  <li><a href="#sigpending">2.7.8 sigpending</a></li>
  <li><a href="#sigsuspend">2.7.9 sigsuspend</a></li>
  <li><a href="#sigwaitinfo">2.7.10 sigwaitinfo</a></li>
  <li><a href="#sigtimedwait">2.7.11 sigtimedwait</a></li>
  <li><a href="#sigqueue">2.7.12 sigqueue</a></li>
  <li><a href="#kill">2.7.13 kill</a></li>
</ul>
patacongo's avatar
patacongo committed

patacongo's avatar
patacongo committed
<H3><a name="sigemptyset">2.7.1 sigemptyset</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigemptyset(sigset_t *set);
</PRE>

<P>
<B>Description:</B> This function initializes the signal set specified
by set such that all signals are excluded.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. Signal set to initialize.
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if the signal set cannot be initialized.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigfillset">2.7.2 sigfillset</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigfillset(sigset_t *set);
</PRE>

<P>
<B>Description:</B> This function initializes the signal set specified
by set such that all signals are included.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. Signal set to initialize
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if the signal set cannot be initialized.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigaddset">2.7.3 sigaddset</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigaddset(sigset_t *set, int signo);
</PRE>

<P>
<B>Description:</B> This function adds the signal specified by
signo to the signal set specified by set.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. Signal set to add signal to
<LI><I>signo</I>. Signal to add
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if the signal number is invalid.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigdelset">2.7.4 sigdelset</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigdelset(sigset_t *set, int signo);
</PRE>

<P>
<B>Description:</B> This function deletes the signal specified
by signo from the signal set specified by set.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. Signal set to delete the signal from
<LI><I>signo</I>. Signal to delete
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if the signal number is invalid.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigismember">2.7.5 sigismember</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int  sigismember(const sigset_t *set, int signo);
</PRE>

<P>
<B>Description:</B> This function tests whether the signal specified
by signo is a member of the set specified by set.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. Signal set to test
<LI><I>signo</I>. Signal to test for
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>1 (TRUE), if the specified signal is a member of the set,
<LI>0 (OK or FALSE), if it is not, or
<LI>-1 (ERROR) if the signal number is invalid.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigaction">2.7.6 sigaction</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigaction( int signo, const struct sigaction *act,
                   struct sigaction *oact );
</PRE>

<P>
<B>Description:</B> This function allows the calling task to
examine and/or specify the action to be associated with a specific
signal.
<P>
The structure sigaction, used to describe an action to be taken, is defined
to include the following members:
<UL>
<LI><I>sa_u.sa_handler</I>.  A pointer to a signal-catching function.
<LI><I>sa_u.sa_sigaction</I>.  An alternative form for the signal catching
function.
<LI><I>sa_mask</I>.  Additional set of signals to be blocked during
execution of the signal-catching function.
<LI><I>sa_flags</I>:  Special flags to affect behavior of a signal.
</UL>
<P>
If the argument act is not NULL, it points to a structure specifying the
action to be associated with the specified signal.  If the argument oact
is not NULL, the action previously associated with the signal is stored
in the location pointed to by the argument oact.  If the argument act is
NULL, signal handling is unchanged by this function call; thus, the call
can be used to enquire about the current handling of a given signal.
<P>
When a signal is caught by a signal-catching function installed by the
sigaction() function, a new signal mask is calculated and installed for
the duration of the signal-catching function.  This mask is formed by taking
the union of the current signal mask and the value of the sa_mask for the
signal being delivered, and then including the signal being delivered.  If
and when the signal handler returns, the original signal mask is restored.
<P>
Signal catching functions execute in the same address environment as the
task that called sigaction() to install the signal-catching function.
<P>
Once an action is installed for a specific signal, it remains installed
until another action is explicitly requested by another call to
sigaction().
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>sig</I>. Signal of interest
<LI><I>act</I>. Location of new handler
<LI><I>oact</I>. Location to store old handler
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if the signal number is invalid.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.
Differences from the POSIX implementation include:
<UL>
<LI>Special values of sa_handler in the struct sigaction act input
not handled (SIG_DFL, SIG_IGN).
<LI>All sa_flags in struct sigaction of act input are ignored
(all treated like SA_SIGINFO).
</UL>

patacongo's avatar
patacongo committed
<H3><a name="sigprocmask">2.7.7 sigprocmask</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
</PRE>

<P>
<B>Description:</B> This function allows the calling task to
examine and/or change its signal mask. If the set is not NULL,
then it points to a set of signals to be used to change the currently
blocked set. The value of how indicates the manner in which the
set is changed.
<P>
If there are any pending unblocked signals after the call to sigprocmask(),
those signals will be delivered before sigprocmask() returns.
<P>
If sigprocmask() fails, the signal mask of the task is not changed.
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>how</I>. How the signal mast will be changed:
<UL>
<LI><I>osSIG_BLOCK</I>. The resulting set is the union of the
current set and the signal set pointed to by the <I>set</I> input parameter.
<LI><I>osSIG_UNBLOCK</I>. The resulting set is the intersection
of the current set and the complement of the signal set pointed
to by the <I>set</I> input parameter.
<LI><I>osSIG_SETMASK</I>. The resulting set is the signal set
pointed to by the <I>set</I> input parameter.
</UL>

<LI><I>set</I>. Location of the new signal mask
<LI><I>oset</I>. Location to store the old signal mask
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK), or -1 (ERROR) if how is invalid.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigpending">2.7.8 sigpending</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigpending( sigset_t *set );
</PRE>

<P>
<B>Description:</B> This function stores the returns the set of
signals that are blocked for delivery and that are pending for
the calling task in the space pointed to by set.
<P>
If the task receiving a signal has the signal blocked via its
sigprocmask, the signal will pend until it is unmasked.  Only one pending
signal (for a given signo) is retained by the system.  This is consistent
with POSIX which states:  &quot;If a subsequent occurrence of a pending
signal is generated, it is implementation defined as to whether the signal
is delivered more than once.&quot;
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>. The location to return the pending signal set.
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>0 (OK) or -1 (ERROR)
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigsuspend">2.7.9 sigsuspend</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigsuspend( const sigset_t *set );
</PRE>

<P>
<B>Description:</B> The sigsuspend() function replaces the signal mask
with the set of signals pointed to by the argument set and then suspends
the task until delivery of a signal to the task.
<P>
If the effect of the set argument is to unblock a pending signal, then
no wait is performed.
<P>
The original signal mask is restored when sigsuspend() returns.
<P>
Waiting for an empty signal set stops a task without freeing any
resources (a very bad idea).
<P>
<B>Input Parameters:</B>
<UL>
<LI><I>set</I>.  The value of the signal <B>mask</B> to use while
suspended.
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>-1 (ERROR) always
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.
Differences from the POSIX specification include:
<UL>
<LI>POSIX does not indicate that the original signal mask is restored.
<LI>POSIX states that sigsuspend() &quot;suspends the task until
delivery of a signal whose action is either to execute a signal-catching
function or to terminate the task.&quot;  Only delivery of the signal
is required in the present implementation (even if the signal is ignored).
</UL>

patacongo's avatar
patacongo committed
<H3><a name="sigwaitinfo">2.7.10 sigwaitinfo</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigwaitinfo(const sigset_t *set, struct siginfo *info);
</PRE>

<P>
<B>Description:</B> This function is equivalent to sigtimedwait()
with a NULL timeout parameter. (see below).
<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>.  The set of pending signals to wait for.
<LI><I>info</I>. The returned signal values
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>Signal number that cause the wait to be terminated, otherwise
-1 (ERROR) is returned.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="sigtimedwait">2.7.11 sigtimedwait</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigtimedwait( const sigset_t *set, struct siginfo *info,
                      const struct timespec *timeout );
</PRE>

<P>
<B>Description:</B> This function selects the pending signal set
specified by the argument set. If multiple signals are pending in set,
it will remove and return the lowest numbered one. If no signals in set
are pending at the time of the call, the calling task will be suspended
until one of the signals in set becomes pending OR until the task
interrupted by an unblocked signal OR until the time interval specified by
timeout (if any), has expired. If timeout is NULL, then the timeout interval
is forever.
<P>
If the info argument is non-NULL, the selected signal number is
stored in the si_signo member and the cause of the signal is store
in the si_code member. The content of si_value is only meaningful
if the signal was generated by sigqueue(). The following values
for si_code are defined in signal.h:
<UL>
  <LI><I>SI_USER</I>. Signal sent from kill, raise, or abort
  <LI><I>SI_QUEUE</I>. Signal sent from sigqueue
  <LI><I>SI_TIMER</I>. Signal is result of timer expiration
  <LI><I>SI_ASYNCIO</I>. Signal is the result of asynch IO completion 
  <LI><I>SI_MESGQ</I>. Signal generated by arrival of a message on an empty message queue.
patacongo's avatar
patacongo committed
</UL>

<P>
<B>Input Parameters:</B> 
<UL>
<LI><I>set</I>.  The set of pending signals to wait for.
<LI><I>info</I>. The returned signal values
<LI><I>timeout</I>. The amount of time to wait
</UL>

<P>
<B>Returned Values:</B> 
<UL>
<LI>Signal number that cause the wait to be terminated, otherwise
-1 (ERROR) is returned.
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.
Differences from the POSIX interface include:
<UL>
<LI>Values for si_codes differ
<LI>No mechanism to return cause of ERROR. (It can be inferred
from si_code in a non-standard way).
<LI>POSIX states that &quot;If no signal is pending at the time of the
call, the calling task shall be suspended until one or more signals
in set become pending or until it is interrupted by an unblocked,
<I>caught</I> signal.&quot;  The present implementation does not require
that the unblocked signal be caught; the task will be resumed even if
the unblocked signal is ignored.
</UL>

patacongo's avatar
patacongo committed
<H3><a name="sigqueue">2.7.12 sigqueue</a></H3>
patacongo's avatar
patacongo committed

<P>
<B>Function Prototype:</B> 
<PRE>
    #include &lt;signal.h&gt;
    int sigqueue (int tid, int signo, const union sigval value);
</PRE>

<P>
<B>Description:</B> This function sends the signal specified by
signo with the signal parameter value to the task specified
by tid.
<P>
If the receiving task has the signal blocked via its sigprocmask,
the signal will pend until it is unmasked.  Only one pending signal
(for a given signo) is retained by the system.  This is consistent with
POSIX which states:  &quot;If a subsequent occurrence of a pending signal
is generated, it is implementation defined as to whether the signal
is delivered more than once.&quot;
<P>
<B>Input Parameters:</B> 
<UL>
patacongo's avatar
patacongo committed
<LI><I>tid</I>. ID of the task to receive signal
patacongo's avatar
patacongo committed
<LI><I>signo</I>. Signal number
<LI><I>value</I>. Value to pass to task with signal
</UL>

<P>
<B>Returned Values:</B> 
<UL>
patacongo's avatar
patacongo committed
<LI>
  On  success (at least one signal was sent), zero (OK) is returned.
  On error, -1 (ERROR) is returned, and errno is set appropriately.
  <ul>
    <li><code>EGAIN</code>. The limit of signals which may be queued has been reached.</li>
    <li><code>EINVAL</code>. signo was invalid.</li>
    <li><code>EPERM</code>.  The task does not have permission to send the signal to the receiving process.</li>
    <li><code>ESRCH</code>. No process has a PID matching pid.</li>
  </ul>
patacongo's avatar
patacongo committed
</UL>

<P>
<B>Assumptions/Limitations:</B> 
<P>
<B>  POSIX  Compatibility:</B> Comparable to the POSIX
interface of the same name.
Differences from the POSIX interface include:
<UL>
<LI>Default action is to ignore signals.
<LI>Signals are processed one at a time in order
<LI>POSIX states that, &quot;If signo is zero (the null signal), error
checking will be performed but no signal is actually sent.&quot;
There is no null signal in the present implementation; a zero signal will
be sent.
</UL>

patacongo's avatar
patacongo committed
<H3><a name="kill">2.7.13 kill</a></H3>

patacongo's avatar
patacongo committed
<P>
patacongo's avatar
patacongo committed
<B>Function Prototype:</B> 
<PRE>
   #include &lt;sys/types.h&gt;
   #include &ltsignal.h&gt;
   int kill(pid_t pid, int sig);
</PRE>

<P>
<B>Description:</B> 
  The kill() system call can be used to send any signal to
  any task.
</p>
<p>
  If the receiving task has the signal blocked via its sigprocmask,
  the signal will pend until it is unmasked.  Only one pending signal
  (for a given signo) is retained by the system.  This is consistent with
  POSIX which states:  &quot;If a subsequent occurrence of a pending signal
  is generated, it is implementation defined as to whether the signal
  is delivered more than once.&quot;
</p>
<p>
<b>Input Parameters:</b> 
<ul>
<li><I>pid</I>. The id of the task to receive the signal.
  The POSIX <code>kill()</code> specification encodes process group
  information as zero and negative pid values.
  Only positive, non-zero values of pid are supported by this
  implementation. ID of the task to receive signal
<LI><I>signo</I>. The signal number to send.
</UL>

<p>
  <B>Returned Values:</B> 
  <UL>
    <LI>OK or ERROR
  </UL>
</p>

<p>
  <B>Assumptions/Limitations:</B> 
</p>
<p>
  <b>POSIX  Compatibility:</b>
    Comparable to the POSIX interface of the same name.
    Differences from the POSIX interface include:
</p>
<ul>
  <li>Default action is to ignore signals.</li>
  <li>Signals are processed one at a time in order </li>
  <li>Sending of signals to 'process groups' is not supported in NuttX.</li>
</ul>

<H2>2.8 <A NAME="Pthread">Pthread Interfaces</A></H2>
<ul>
  <li><a href="#pthreadattrinit">2.8.1 pthread_attr_init</a></li>
  <li><a href="#pthreadattrdestroy">2.8.2 pthread_attr_destroy</a></li>
  <li><a href="#pthreadattrsetschedpolity">2.8.3 pthread_attr_setschedpolicy</a></li>
  <li><a href="#pthreadattrgetschedpolicy">2.8.4 pthread_attr_getschedpolicy</a></li>
  <li><a href="#pthreadattrsetschedparam">2.8.5 pthread_attr_setschedparam</a></li>
  <li><a href="#pthreadattrgetschedparam">2.8.6 pthread_attr_getschedparam</a></li>
  <li><a href="#pthreadattrsetinheritsched">2.8.7 pthread_attr_setinheritsched</a></li>
  <li><a href="#pthreadattrgetinheritsched">2.8.8 pthread_attr_getinheritsched</a></li>
  <li><a href="#pthreadattrsetstacksize">2.8.9 pthread_attr_setstacksize</a></li>
  <li><a href="#pthreadattrgetstacksize">2.8.10 pthread_attr_getstacksize</a></li>
  <li><a href="#pthreadcreate">2.8.11 pthread_create</a></li>
  <li><a href="#pthreaddetach">2.8.12 pthread_detach</a></li>
  <li><a href="#pthreadexit">2.8.13 pthread_exit</a></li>
  <li><a href="#pthreadcancel">2.8.14 pthread_cancel</a></li>
  <li><a href="#pthreadsetcancelstate">2.8.15 pthread_setcancelstate</a></li>
  <li><a href="#pthreadtestcancelstate">2.8.16 pthread_testcancelstate</a></li>
  <li><a href="#pthreadjoin">2.8.17 pthread_join</a></li>
  <li><a href="#pthreadyield">2.8.18 pthread_yield</a></li>
  <li><a href="#pthreadself">2.8.19 pthread_self</a></li>
  <li><a href="#pthreadgetschedparam">2.8.20 pthread_getschedparam</a></li>
  <li><a href="#pthreadsetschedparam">2.8.21 pthread_setschedparam</a></li>
  <li><a href="#pthreadkeycreate">2.8.22 pthread_key_create</a></li>
  <li><a href="#pthreadsetspecific">2.8.23 pthread_setspecific</a></li>
  <li><a href="#pthreadgetspecific">2.8.24 pthread_getspecific</a></li>
  <li><a href="#pthreadkeydelete">2.8.25 pthread_key_delete</a></li>
  <li><a href="#pthreadmutexattrinit">2.8.26 pthread_mutexattr_init</a></li>
  <li><a href="#pthreadmutexattrdestroy">2.8.27 pthread_mutexattr_destroy</a></li>
  <li><a href="#pthreadmutexattrgetpshared">2.8.28 pthread_mutexattr_getpshared</a></li>
  <li><a href="#pthreadmutexattrsetpshared">2.8.29 pthread_mutexattr_setpshared</a></li>
  <li><a href="#pthreadmutexinit">2.8.30 pthread_mutex_init</a></li>
  <li><a href="#pthreadmutexdestrory">2.8.31 pthread_mutex_destroy</a></li>
  <li><a href="#pthreadmutexlock">2.8.32 pthread_mutex_lock</a></li>
  <li><a href="#pthreadmutextrylock">2.8.33 pthread_mutex_trylock</a></li>
  <li><a href="#pthreadmutexunlock">2.8.34 pthread_mutex_unlock</a></li>
  <li><a href="#pthreadconaddrinit">2.8.35 pthread_condattr_init</a></li>
  <li><a href="#pthreadocndattrdestroy">2.8.36 pthread_condattr_destroy</a></li>
  <li><a href="#pthreadcondinit">2.8.37 pthread_cond_init</a></li>
  <li><a href="#pthreadconddestroy">2.8.38 pthread_cond_destroy</a></li>
  <li><a href="#pthreadcondbroadcast">2.8.39 pthread_cond_broadcast</a></li>
  <li><a href="#pthreadcondsignal">2.8.40 pthread_cond_signal</a></li>
  <li><a href="#pthreadcondwait">2.8.41 pthread_cond_wait</a></li>
  <li><a href="#pthreadcondtimedwait">2.8.42 pthread_cond_timedwait</a></li>
</ul>

<H3><a name="pthreadattrinit">2.8.1 pthread_attr_init</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
    #include &lt;pthread.h&gt;
    int pthread_attr_init(pthread_attr_t *attr);
</PRE>
<P>
<B>Description:</B>
Initializes a thread attributes object (attr) with default values
for all of the individual attributes used by the implementation.
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.
<P>
patacongo's avatar
patacongo committed
<H3><a name="pthreadattrdestroy">2.8.2 pthread_attr_destroy</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
    #include &lt;pthread.h&gt;
    int pthread_attr_destroy(pthread_attr_t *attr);
</PRE>
<P>
<B>Description:</B>
An attributes object can be deleted when it is no longer needed.
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.
<P>
patacongo's avatar
patacongo committed
<H3><a name="pthreadattrsetschedpolity">2.8.3 pthread_attr_setschedpolicy</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
    #include &lt;pthread.h&gt;
    int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrgetschedpolicy">2.8.4 pthread_attr_getschedpolicy</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
    #include &lt;pthread.h&gt;
    int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrsetschedparam">2.8.5 pthread_attr_setschedparam</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
   #include &lt;pthread.h&gt;
    int pthread_attr_setschedparam(pthread_attr_t *attr,
				      const struct sched_param *param);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrgetschedparam">2.8.6 pthread_attr_getschedparam</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
   #include &lt;pthread.h&gt;
     int pthread_attr_getschedparam(pthread_attr_t *attr,
				      struct sched_param *param);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrsetinheritsched">2.8.7 pthread_attr_setinheritsched</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
   #include &lt;pthread.h&gt;
    int pthread_attr_setinheritsched(pthread_attr_t *attr,
					int inheritsched);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.
<P>
patacongo's avatar
patacongo committed
<H3><a name="pthreadattrgetinheritsched">2.8.8 pthread_attr_getinheritsched</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
   #include &lt;pthread.h&gt;
     int pthread_attr_getinheritsched(const pthread_attr_t *attr,
					int *inheritsched);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrsetstacksize">2.8.9 pthread_attr_setstacksize</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
   #include &lt;pthread.h&gt;
    int pthread_attr_setstacksize(pthread_attr_t *attr, long stacksize);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadattrgetstacksize">2.8.10 pthread_attr_getstacksize</A></H3>
patacongo's avatar
patacongo committed
<P>
<B>Function Prototype:</B>
<P>
<PRE>
    #include &lt;pthread.h&gt;
   int pthread_attr_getstacksize(pthread_attr_t *attr, long *stackaddr);
</PRE>
<P>
<B>Description:</B>
<P>
<B>Input Parameters:</B>
<P>
<UL>
<LI><I>parm</I> 
</UL>
<P>
<B>Returned Values:</B>
<P>
If successful, the <I>xxx()</I> function will return
zero (<I>OK</I>).  Otherwise, an error number will be
returned to indicate the error:
<P>
<UL>
<LI><I>Exxx</I>.
</UL>
<B>Assumptions/Limitations:</B>
<P>
<B>POSIX Compatibility:</B> Comparable to the POSIX
interface of the same name.

patacongo's avatar
patacongo committed
<H3><a name="pthreadcreate">2.8.11 pthread_create</A></H3>
patacongo's avatar
patacongo committed
<P>