Newer
Older
<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
<H3><a name="sigismember">2.8.5 sigismember</a></H3>
#include <signal.h>
int sigismember(const sigset_t *set, int signo);
<p>
<b>Description:</b> This function tests whether the signal specified
<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
<H3><a name="sigaction">2.8.6 sigaction</a></H3>
#include <signal.h>
int sigaction( int signo, const struct sigaction *act,
struct sigaction *oact );
<p>
<b>Description:</b> This function allows the calling task to
examine and/or specify the action to be associated with a specific
signal.
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
<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.
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.
Signal catching functions execute in the same address environment as the
task that called sigaction() to install the signal-catching function.
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
<H3><a name="sigprocmask">2.8.7 sigprocmask</a></H3>
#include <signal.h>
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
<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.
If there are any pending unblocked signals after the call to sigprocmask(),
those signals will be delivered before sigprocmask() returns.
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>SIG_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>SIG_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>SIG_SETMASK</I>. The resulting set is the signal set
</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
<H3><a name="sigpending">2.8.8 sigpending</a></H3>
<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.
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: "If a subsequent occurrence of a pending
signal is generated, it is implementation defined as to whether the signal
is delivered more than once."
<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
<H3><a name="sigsuspend">2.8.9 sigsuspend</a></H3>
#include <signal.h>
int sigsuspend( const sigset_t *set );
<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.
If the effect of the set argument is to unblock a pending signal, then
no wait is performed.
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
</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() "suspends the task until
delivery of a signal whose action is either to execute a signal-catching
function or to terminate the task." Only delivery of the signal
is required in the present implementation (even if the signal is ignored).
<H3><a name="sigwaitinfo">2.8.10 sigwaitinfo</a></H3>
#include <signal.h>
int sigwaitinfo(const sigset_t *set, struct siginfo *info);
<p>
<b>Description:</b> This function is equivalent to sigtimedwait()
<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
<p>
<b>Assumptions/Limitations:</b>
<p>
<b> POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="sigtimedwait">2.8.11 sigtimedwait</a></H3>
#include <signal.h>
int sigtimedwait( const sigset_t *set, struct siginfo *info,
const struct timespec *timeout );
<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.
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.
</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
<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
<li>POSIX states that "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." The present implementation does not require
that the unblocked signal be caught; the task will be resumed even if
the unblocked signal is ignored.
<H3><a name="sigqueue">2.8.12 sigqueue</a></H3>
int sigqueue (int tid, int signo, union sigval value);
<p>
<b>Description:</b> This function sends the signal specified by
signo with the signal parameter value to the task specified
by tid.
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: "If a subsequent occurrence of a pending signal
is generated, it is implementation defined as to whether the signal
is delivered more than once."
<p>
<b>Input Parameters:</b>
<ul>
<li><I>tid</I>. ID of the task to receive signal
<li><I>signo</I>. Signal number
<li><I>value</I>. Value to pass to task with signal
</ul>
<p>
<b>Returned Values:</b>
<ul>
<li>
On success (at least one signal was sent), zero (OK) is returned.
On error, -1 (ERROR) is returned, and <a href="#ErrnoAccess"><code>errno</code></a> 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>
<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, "If signo is zero (the null signal), error
checking will be performed but no signal is actually sent."
There is no null signal in the present implementation; a zero signal will
be sent.
<H3><a name="kill">2.8.13 kill</a></H3>
#include <sys/types.h>
#include <signal.h>
int kill(pid_t pid, int sig);
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: "If a subsequent occurrence of a pending signal
is generated, it is implementation defined as to whether the signal
is delivered more than once."
</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
If signo is zero, no signal is sent, but all error checking is performed.
</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>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>
<a name="Pthread"><h2>2.9 Pthread Interfaces</h2></a>
</td>
</tr>
</table>
<p>
NuttX does not support <i>processes</i> in the way that, say, Linux does.
NuttX only supports simple threads or tasks running within the same address space.
For the most part, threads and tasks are interchangeable and differ primarily
only in such things as the inheritance of file descriptors.
Basically, threads are initialized and uninitialized differently and share a
few more resources than tasks.
<p>
The following pthread interfaces are supported in some form by NuttX:
</p>
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
<li><a href="#pthreadattrinit">2.9.1 pthread_attr_init</a></li>
<li><a href="#pthreadattrdestroy">2.9.2 pthread_attr_destroy</a></li>
<li><a href="#pthreadattrsetschedpolity">2.9.3 pthread_attr_setschedpolicy</a></li>
<li><a href="#pthreadattrgetschedpolicy">2.9.4 pthread_attr_getschedpolicy</a></li>
<li><a href="#pthreadattrsetschedparam">2.9.5 pthread_attr_setschedparam</a></li>
<li><a href="#pthreadattrgetschedparam">2.9.6 pthread_attr_getschedparam</a></li>
<li><a href="#pthreadattrsetinheritsched">2.9.7 pthread_attr_setinheritsched</a></li>
<li><a href="#pthreadattrgetinheritsched">2.9.8 pthread_attr_getinheritsched</a></li>
<li><a href="#pthreadattrsetstacksize">2.9.9 pthread_attr_setstacksize</a></li>
<li><a href="#pthreadattrgetstacksize">2.9.10 pthread_attr_getstacksize</a></li>
<li><a href="#pthreadcreate">2.9.11 pthread_create</a></li>
<li><a href="#pthreaddetach">2.9.12 pthread_detach</a></li>
<li><a href="#pthreadexit">2.9.13 pthread_exit</a></li>
<li><a href="#pthreadcancel">2.9.14 pthread_cancel</a></li>
<li><a href="#pthreadsetcancelstate">2.9.15 pthread_setcancelstate</a></li>
<li><a href="#pthreadtestcancelstate">2.9.16 pthread_testcancelstate</a></li>
<li><a href="#pthreadjoin">2.9.17 pthread_join</a></li>
<li><a href="#pthreadyield">2.9.18 pthread_yield</a></li>
<li><a href="#pthreadself">2.9.19 pthread_self</a></li>
<li><a href="#pthreadgetschedparam">2.9.20 pthread_getschedparam</a></li>
<li><a href="#pthreadsetschedparam">2.9.21 pthread_setschedparam</a></li>
<li><a href="#pthreadkeycreate">2.9.22 pthread_key_create</a></li>
<li><a href="#pthreadsetspecific">2.9.23 pthread_setspecific</a></li>
<li><a href="#pthreadgetspecific">2.9.24 pthread_getspecific</a></li>
<li><a href="#pthreadkeydelete">2.9.25 pthread_key_delete</a></li>
<li><a href="#pthreadmutexattrinit">2.9.26 pthread_mutexattr_init</a></li>
<li><a href="#pthreadmutexattrdestroy">2.9.27 pthread_mutexattr_destroy</a></li>
<li><a href="#pthreadmutexattrgetpshared">2.9.28 pthread_mutexattr_getpshared</a></li>
<li><a href="#pthreadmutexattrsetpshared">2.9.29 pthread_mutexattr_setpshared</a></li>
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
<li><a href="#pthreadmutexattrgettype">2.9.30 pthread_mutexattr_gettype</a></li>
<li><a href="#pthreadmutexattrsettype">2.9.31 pthread_mutexattr_settype</a></li>
<li><a href="#pthreadmutexinit">2.9.32 pthread_mutex_init</a></li>
<li><a href="#pthreadmutexdestrory">2.9.33 pthread_mutex_destroy</a></li>
<li><a href="#pthreadmutexlock">2.9.34 pthread_mutex_lock</a></li>
<li><a href="#pthreadmutextrylock">2.9.35 pthread_mutex_trylock</a></li>
<li><a href="#pthreadmutexunlock">2.9.36 pthread_mutex_unlock</a></li>
<li><a href="#pthreadconaddrinit">2.9.37 pthread_condattr_init</a></li>
<li><a href="#pthreadocndattrdestroy">2.9.38 pthread_condattr_destroy</a></li>
<li><a href="#pthreadcondinit">2.9.39 pthread_cond_init</a></li>
<li><a href="#pthreadconddestroy">2.9.40 pthread_cond_destroy</a></li>
<li><a href="#pthreadcondbroadcast">2.9.41 pthread_cond_broadcast</a></li>
<li><a href="#pthreadcondsignal">2.9.42 pthread_cond_signal</a></li>
<li><a href="#pthreadcondwait">2.9.43 pthread_cond_wait</a></li>
<li><a href="#pthreadcondtimedwait">2.9.44 pthread_cond_timedwait</a></li>
<li><a href="#pthreadbarrierattrinit">2.9.45 pthread_barrierattr_init</a></li>
<li><a href="#pthreadbarrierattrdestroy">2.9.46 pthread_barrierattr_destroy</a></li>
<li><a href="#pthreadbarrierattrsetpshared">2.9.47 pthread_barrierattr_setpshared</a></li>
<li><a href="#pthreadbarrierattrgetpshared">2.9.48 pthread_barrierattr_getpshared</a></li>
<li><a href="#pthreadbarrierinit">2.9.49 pthread_barrier_init</a></li>
<li><a href="#pthreadbarrierdestroy">2.9.50 pthread_barrier_destroy</a></li>
<li><a href="#pthreadbarrierwait">2.9.51 pthread_barrier_wait</a></li>
<li><a href="#pthreadonce">2.9.52 pthread_once</a></li>
<li><a href="#pthreadkill">2.9.53 pthread_kill</a></li>
<li><a href="#pthreadsigmask">2.9.54 pthread_sigmask</a></li>
</ul>
<p>
No support for the following pthread interfaces is provided by NuttX:
</p>
<ul>
<li><code>pthread_atfork</code>. register fork handlers.</li>
<li><code>pthread_attr_getdetachstate</code>. get and set the detachstate attribute.</li>
<li><code>pthread_attr_getguardsize</code>. get and set the thread guardsize attribute.</li>
<li><code>pthread_attr_getinheritsched</code>. get and set the inheritsched attribute.</li>
<li><code>pthread_attr_getscope</code>. get and set the contentionscope attribute.</li>
<li><code>pthread_attr_getstack</code>. get and set stack attributes.</li>
<li><code>pthread_attr_getstackaddr</code>. get and set the stackaddr attribute.</li>
<li><code>pthread_attr_setdetachstate</code>. get and set the detachstate attribute.</li>
<li><code>pthread_attr_setguardsize</code>. get and set the thread guardsize attribute.</li>
<li><code>pthread_attr_setscope</code>. get and set the contentionscope attribute.</li>
<li><code>pthread_attr_setstack</code>. get and set stack attributes.</li>
<li><code>pthread_attr_setstackaddr</code>. get and set the stackaddr attribute.</li>
<li><code>pthread_barrier_destroy</code>. destroy and initialize a barrier object.</li>
<li><code>pthread_barrier_init</code>. destroy and initialize a barrier object.</li>
<li><code>pthread_barrier_wait</code>. synchronize at a barrier.</li>
<li><code>pthread_cleanup_pop</code>. establish cancellation handlers.</li>
<li><code>pthread_cleanup_push</code>. establish cancellation handlers.</li>
<li><code>pthread_condattr_getclock</code>. set the clock selection condition variable attribute.</li>
<li><code>pthread_condattr_getpshared</code>. get the process-shared condition variable attribute.</li>
<li><code>pthread_condattr_setclock</code>. set the clock selection condition variable attribute.</li>
<li><code>pthread_condattr_setpshared</code>. set the process-shared condition variable attribute.</li>
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
<li><code>pthread_getconcurrency</code>. get and set the level of concurrency.</li>
<li><code>pthread_getcpuclockid</code>. access a thread CPU-time clock.</li>
<li><code>pthread_mutex_getprioceiling</code>. get and set the priority ceiling of a mutex.</li>
<li><code>pthread_mutex_setprioceiling</code>. get and set the priority ceiling of a mutex.</li>
<li><code>pthread_mutex_timedlock</code>. lock a mutex.</li>
<li><code>pthread_mutexattr_getprioceiling</code>. get and set the prioceiling attribute of the mutex attributes object.</li>
<li><code>pthread_mutexattr_getprotocol</code>. get and set the protocol attribute of the mutex attributes object.</li>
<li><code>pthread_mutexattr_setprioceiling</code>. get and set the prioceiling attribute of the mutex attributes object.</li>
<li><code>pthread_mutexattr_setprotocol</code>. get and set the protocol attribute of the mutex attributes object.</li>
<li><code>pthread_rwlock_destroy</code>. destroy and initialize a read-write lock object.</li>
<li><code>pthread_rwlock_init</code>. destroy and initialize a read-write lock object.</li>
<li><code>pthread_rwlock_rdlock</code>. lock a read-write lock object for reading.</li>
<li><code>pthread_rwlock_timedrdlock</code>. lock a read-write lock for reading.</li>
<li><code>pthread_rwlock_timedwrlock</code>. lock a read-write lock for writing.</li>
<li><code>pthread_rwlock_tryrdlock</code>. lock a read-write lock object for reading.</li>
<li><code>pthread_rwlock_trywrlock</code>. lock a read-write lock object for writing.</li>
<li><code>pthread_rwlock_unlock</code>. unlock a read-write lock object.</li>
<li><code>pthread_rwlock_wrlock</code>. lock a read-write lock object for writing.</li>
<li><code>pthread_rwlockattr_destroy</code>. destroy and initialize the read-write lock attributes object.</li>
<li><code>pthread_rwlockattr_getpshared</code>. get and set the process-shared attribute of the read-write lock attributes object.</li>
<li><code>pthread_rwlockattr_init</code>. destroy and initialize the read-write lock attributes object.</li>
<li><code>pthread_rwlockattr_setpshared</code>. get and set the process-shared attribute of the read-write lock attributes object.</li>
<li><code>pthread_setcanceltype</code>. set cancelability state.</li>
<li><code>pthread_setconcurrency</code>. get and set the level of concurrency.</li>
<li><code>pthread_spin_destroy</code>. destroy or initialize a spin lock object.</li>
<li><code>pthread_spin_init</code>. destroy or initialize a spin lock object.</li>
<li><code>pthread_spin_lock</code>. lock a spin lock object.</li>
<li><code>pthread_spin_trylock</code>. lock a spin lock object.</li>
<li><code>pthread_spin_unlock</code>. unlock a spin lock object.</li>
<li><code>pthread_testcancel</code>. set cancelability state.</li>
</ul>
<H3><a name="pthreadattrinit">2.9.1 pthread_attr_init</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_init(pthread_attr_t *attr);
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><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_init()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<p>
<H3><a name="pthreadattrdestroy">2.9.2 pthread_attr_destroy</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_destroy(pthread_attr_t *attr);
An attributes object can be deleted when it is no longer needed.
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_destroy()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<p>
<H3><a name="pthreadattrsetschedpolity">2.9.3 pthread_attr_setschedpolicy</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_setschedpolicy()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrgetschedpolicy">2.9.4 pthread_attr_getschedpolicy</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_getschedpolicy()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrsetschedparam">2.9.5 pthread_attr_getschedpolicy</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_setschedparam(pthread_attr_t *attr,
const struct sched_param *param);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_getschedpolicy()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrgetschedparam">2.9.6 pthread_attr_getschedparam</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_getschedparam(pthread_attr_t *attr,
struct sched_param *param);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_getschedparam()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrsetinheritsched">2.9.7 pthread_attr_setinheritsched</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_setinheritsched(pthread_attr_t *attr,
int inheritsched);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_setinheritsched()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<p>
<H3><a name="pthreadattrgetinheritsched">2.9.8 pthread_attr_getinheritsched</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_getinheritsched(const pthread_attr_t *attr,
int *inheritsched);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_getinheritsched()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrsetstacksize">2.9.9 pthread_attr_setstacksize</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_setstacksize(pthread_attr_t *attr, long stacksize);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_setstacksize()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadattrgetstacksize">2.9.10 pthread_attr_getstacksize</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_attr_getstacksize(pthread_attr_t *attr, long *stackaddr);
<p>
<b>Description:</b>
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_attr_getstacksize()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadcreate">2.9.11 pthread_create</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_create(pthread_t *thread, pthread_attr_t *attr,
pthread_startroutine_t startRoutine,
pthread_addr_t arg);
To create a thread object and runnable thread, a routine
must be specified as the new thread's start routine. An
argument may be passed to this routine, as an untyped
address; an untyped address may also be returned as the
routine's value. An attributes object may be used to
specify details about the kind of thread being created.
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_create()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreaddetach">2.9.12 pthread_detach</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
int pthread_detach(pthread_t thread);
A thread object may be "detached" to specify that the
return value and completion status will not be requested.
<p>
<b>Input Parameters:</b>
<p>
<ul>
<li><code>To be provided</code>.</li>
</ul>
<p>
<b>Returned Values:</b>
<p>
If successful, the <I>pthread_detach()</I> function will return
zero (<I>OK</I>). Otherwise, an error number will be
returned to indicate the error:
<p>
<ul>
<li><code>To be provided</code>. </li>
</ul>
<b>Assumptions/Limitations:</b>
<p>
<b>POSIX Compatibility:</b> Comparable to the POSIX
<H3><a name="pthreadexit">2.9.13 pthread_exit</a></H3>
<p>
<b>Function Prototype:</b>
<p>
#include <pthread.h>
void pthread_exit(pthread_addr_t pvValue);