1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: Signals services.</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
</div>
<div class="contents">
<h1>Signals services.<br>
<small>
[<a class="el" href="group__posix.html">POSIX skin.</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Signals services.:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__posix__signal.png" border="0" alt="" usemap="#group____posix____signal_map">
<map name="group____posix____signal_map">
<area shape="rect" href="group__posix.html" title="Xenomai POSIX skin is an implementation of a small subset of the Single Unix specification..." alt="" coords="7,5,100,32"></map></td></tr></table></center>
</div>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Signals management services.
<p>
Signals are asynchronous notifications delivered to a process or thread. Such notifications occur as the result of an exceptional event or at the request of another process.<p>
The services documented here are reserved to Xenomai kernel-space threads, user-space threads switch to secondary mode when handling signals, and use Linux regular signals services.<p>
Xenomai POSIX skin signals are implemented as real-time signals, meaning that they are queued when posted several times to a thread before the first notification is handled, and that each signal carry additional data in a <b>siginfo_t</b> object. In order to ensure consistence with user-space signals, valid signals number range from 1 to SIGRTMAX, signals from SIGRTMIN to SIGRTMAX being higher priority than signals from 1 to SIGRTMIN-1. As a special case, signal 0 may be used with services <a class="el" href="group__posix__signal.html#g5aafacc071cdfafd0eb992004dee3e62" title="Send a signal to a thread.">pthread_kill()</a> and <a class="el" href="group__posix__signal.html#g64f37159dcc60bf98364a8950fd05338" title="Queue a signal to a thread.">pthread_sigqueue_np()</a> to check if a thread exists, but entails no other action.<p>
The action to be taken upon reception of a signal depends on the thread signal mask, (see <a class="el" href="group__posix__signal.html#gc2530d4faf68aaab3605c92ea8e78a03" title="Examine and change the set of signals blocked by a thread.">pthread_sigmask()</a>), and on the settings described by a <b>sigaction</b> structure (see <a class="el" href="group__posix__signal.html#gca154d42054802e95c6f8019a8dcf4ac" title="Examine and change a signal action.">sigaction()</a>).
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g5925352f90eb589393274fa0376d7def">sigemptyset</a> (sigset_t *set)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize and empty a signal set. <a href="#g5925352f90eb589393274fa0376d7def"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g88d7bbc77ea1569ee21c90db549ea023">sigfillset</a> (sigset_t *set)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize and fill a signal set. <a href="#g88d7bbc77ea1569ee21c90db549ea023"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#gba080a9ab72ac6d079ff0bf8ac9b23f4">sigaddset</a> (sigset_t *set, int sig)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a signal to a signal set. <a href="#gba080a9ab72ac6d079ff0bf8ac9b23f4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g16efce9e80266d0db1ed9a3ef281ad2b">sigdelset</a> (sigset_t *set, int sig)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a signal from a signal set. <a href="#g16efce9e80266d0db1ed9a3ef281ad2b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g5eaaad0671fbdba01a60ab5b1c8649be">sigismember</a> (const sigset_t *set, int sig)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Test for a signal in a signal set. <a href="#g5eaaad0671fbdba01a60ab5b1c8649be"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#gca154d42054802e95c6f8019a8dcf4ac">sigaction</a> (int sig, const struct sigaction *act, struct sigaction *oact)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Examine and change a signal action. <a href="#gca154d42054802e95c6f8019a8dcf4ac"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g5aafacc071cdfafd0eb992004dee3e62">pthread_kill</a> (pthread_t thread, int sig)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send a signal to a thread. <a href="#g5aafacc071cdfafd0eb992004dee3e62"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g64f37159dcc60bf98364a8950fd05338">pthread_sigqueue_np</a> (pthread_t thread, int sig, union sigval value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Queue a signal to a thread. <a href="#g64f37159dcc60bf98364a8950fd05338"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g7b91eecad5998acd6162fde3ab530d7a">sigpending</a> (sigset_t *set)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Examine pending signals. <a href="#g7b91eecad5998acd6162fde3ab530d7a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#gc2530d4faf68aaab3605c92ea8e78a03">pthread_sigmask</a> (int how, const sigset_t *set, sigset_t *oset)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Examine and change the set of signals blocked by a thread. <a href="#gc2530d4faf68aaab3605c92ea8e78a03"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#gdc0d6eabea5878a70fe1f97b002f5f2a">sigwait</a> (const sigset_t *set, int *sig)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for signals. <a href="#gdc0d6eabea5878a70fe1f97b002f5f2a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#gc9043e9dc6fc22bfb82606932bb3b3ed">sigwaitinfo</a> (const sigset_t *__restrict__ set, siginfo_t *__restrict__ info)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for signals. <a href="#gc9043e9dc6fc22bfb82606932bb3b3ed"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__signal.html#g04cbfbf6045492b2273cc8046cd52d08">sigtimedwait</a> (const sigset_t *__restrict__ set, siginfo_t *__restrict__ info, const struct timespec *__restrict__ timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait during a bounded time for signals. <a href="#g04cbfbf6045492b2273cc8046cd52d08"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g5aafacc071cdfafd0eb992004dee3e62"></a><!-- doxytag: member="signal.c::pthread_kill" ref="g5aafacc071cdfafd0eb992004dee3e62" args="(pthread_t thread, int sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_kill </td>
<td>(</td>
<td class="paramtype">pthread_t </td>
<td class="paramname"> <em>thread</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Send a signal to a thread.
<p>
This service send the signal <em>sig</em> to the Xenomai POSIX skin thread <em>thread</em> (created with <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>). If <em>sig</em> is zero, this service check for existence of the thread <em>thread</em>, but no signal is sent.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>thread</em> </td><td>thread identifier;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>signal number.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>sig</em> is an invalid signal number;</li><li>EAGAIN, the maximum number of pending signals has been exceeded;</li><li>ESRCH, <em>thread</em> is an invalid thread identifier.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_kill.html">Specification.</a> </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="rtcan__rtt_8c-example.html#a25">rtcan_rtt.c</a>.</dl>
<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>.</p>
</div>
</div><p>
<a class="anchor" name="gc2530d4faf68aaab3605c92ea8e78a03"></a><!-- doxytag: member="signal.c::pthread_sigmask" ref="gc2530d4faf68aaab3605c92ea8e78a03" args="(int how, const sigset_t *set, sigset_t *oset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_sigmask </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>how</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const sigset_t * </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>oset</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Examine and change the set of signals blocked by a thread.
<p>
The signal mask of a thread is the set of signals that are blocked by this thread.<p>
If <em>oset</em> is not NULL, this service stores, at the address <em>oset</em> the current signal mask of the calling thread.<p>
If <em>set</em> is not NULL, this service sets the signal mask of the calling thread according to the value of <em>how</em>, as follow:<ul>
<li>if <em>how</em> is SIG_BLOCK, the signals in <em>set</em> are added to the calling thread signal mask;</li><li>if <em>how</em> is SIG_SETMASK, the calling thread signal mask is set to <em>set</em>;</li><li>if <em>how</em> is SIG_UNBLOCK, the signals in <em>set</em> are removed from the calling thread signal mask.</li></ul>
<p>
If some signals are unblocked by this service, they are handled before this service returns.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>how</em> </td><td>if <em>set</em> is not null, a value indicating how to interpret <em>set</em>;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>if not null, a signal set that will be used to modify the calling thread signal mask;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>oset</em> </td><td>if not null, address where the previous value of the calling thread signal mask will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EPERM, the calling context is invalid;</li><li>EINVAL, <em>how</em> is not SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_sigmask.html">Specification.</a> </dd></dl>
<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>.</p>
</div>
</div><p>
<a class="anchor" name="g64f37159dcc60bf98364a8950fd05338"></a><!-- doxytag: member="signal.c::pthread_sigqueue_np" ref="g64f37159dcc60bf98364a8950fd05338" args="(pthread_t thread, int sig, union sigval value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_sigqueue_np </td>
<td>(</td>
<td class="paramtype">pthread_t </td>
<td class="paramname"> <em>thread</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">union sigval </td>
<td class="paramname"> <em>value</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Queue a signal to a thread.
<p>
This service send the signal <em>sig</em> to the Xenomai POSIX skin thread <em>thread</em> (created with <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>), with the value <em>value</em>. If <em>sig</em> is zero, this service check for existence of the thread <em>thread</em>, but no signal is sent.<p>
This service is equivalent to the POSIX service sigqueue(), except that the signal is directed to a thread instead of being directed to a process.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>thread</em> </td><td>thread identifier,</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>signal number,</td></tr>
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>additional datum passed to <em>thread</em> with the signal <em>sig</em>.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>sig</em> is an invalid signal number;</li><li>EAGAIN, the maximum number of pending signals has been exceeded;</li><li>ESRCH, <em>thread</em> is an invalid thread identifier.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigqueue.html">sigqueue() specification.</a> </dd></dl>
<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>.</p>
</div>
</div><p>
<a class="anchor" name="gca154d42054802e95c6f8019a8dcf4ac"></a><!-- doxytag: member="signal.c::sigaction" ref="gca154d42054802e95c6f8019a8dcf4ac" args="(int sig, const struct sigaction *act, struct sigaction *oact)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigaction </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct sigaction * </td>
<td class="paramname"> <em>act</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct sigaction * </td>
<td class="paramname"> <em>oact</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Examine and change a signal action.
<p>
The <b>sigaction</b> structure descibes the actions to be taken upon signal delivery. A <b>sigaction</b> structure is associated with every signal, for the kernel-space as a whole.<p>
If <em>oact</em> is not <em>NULL</em>, this service returns at the address <em>oact</em>, the current value of the <b>sigaction</b> structure associated with the signal <em>sig</em>.<p>
If <em>act</em> is not <em>NULL</em>, this service set to the value pointed to by <em>act</em>, the <b>sigaction</b> structure associated with the signal <em>sig</em>.<p>
The structure <b>sigaction</b> has the following members:<ul>
<li><em>sa_flags</em>, is a bitwise OR of the flags;<ul>
<li>SA_RESETHAND, meaning that the signal handler will be reset to SIG_GFL and SA_SIGINFO cleared upon reception of a signal,</li><li>SA_NODEFER, meaning that the signal handler will be called with the signal <em>sig</em> not masked when handling the signal <em>sig</em>,</li><li>SA_SIGINFO, meaning that the member <em>sa_sigaction</em> of the <b>sigaction</b> structure will be used as a signal handler instead of <em>sa_handler</em> </li></ul>
</li><li><em>sa_mask</em>, of type <b>sigset_t</b>, is the value to which the thread signals mask will be set during execution of the signal handler (<em>sig</em> is automatically added to this set if SA_NODEFER is not set in <em>sa_flags</em>);</li><li><em>sa_handler</em>, of type <b>void (*)(int)</b> is the signal handler which will be called upon signal delivery if SA_SIGINFO is not set in <em>sa_flags</em>, or one of SIG_IGN or SIG_DFL, meaning that the signal will be respectively ignored or handled with the default handler;</li><li><em>sa_sigaction</em>, of type <b>void (*)(int, siginfo_t *, void *)</b> is the signal handler which will be called upon signal delivery if SA_SIGINFO is set in <em>sa_flags</em>.</li></ul>
<p>
When using <em>sa_handler</em> as a signal handler, it is passed the number of the received signal, when using <em>sa_sigaction</em>, two additional arguments are passed:<ul>
<li>a pointer to a <b>siginfo_t</b> object, containing additional information about the received signal;</li><li>a void pointer, always null in this implementation.</li></ul>
<p>
The following members of the <b>siginfo_t</b> structure are filled by this implementation:<ul>
<li><em>si_signo</em>, the signal number;</li><li><em>si_code</em>, the provenance of the signal, one of:<ul>
<li>SI_QUEUE, the signal was queued with <a class="el" href="group__posix__signal.html#g64f37159dcc60bf98364a8950fd05338" title="Queue a signal to a thread.">pthread_sigqueue_np()</a>,</li><li>SI_USER, the signal was queued with <a class="el" href="group__posix__signal.html#g5aafacc071cdfafd0eb992004dee3e62" title="Send a signal to a thread.">pthread_kill()</a>,</li><li>SI_TIMER, the signal was queued by a timer (see <a class="el" href="group__posix__time.html#g2b1ff7e69f27d7aec7950b42494fa61f" title="Start or stop a timer.">timer_settime()</a>),</li><li>SI_MESQ, the signal was queued by a message queue (see <a class="el" href="group__posix__mq.html#g346fbeb512b59ecf90be445718724936" title="Register the current thread to be notified of message arrival at an empty message...">mq_notify()</a>);</li></ul>
</li><li><em>si_value</em>, an additional datum, of type <b>union</b> <b>sigval</b>.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>a signal number;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>act</em> </td><td>if not null, description of the action to be taken upon notification of the signal <em>sig</em>;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>oact</em> </td><td>if not null, address where the previous description of the signal action is stored on success.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on sucess; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EINVAL, <em>sig</em> is an invalid signal number;</li><li>ENOTSUP, the <em>sa_flags</em> member of <em>act</em> contains other flags than SA_RESETHAND, SA_NODEFER and SA_SIGINFO;</li></ul>
</td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigaction.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gba080a9ab72ac6d079ff0bf8ac9b23f4"></a><!-- doxytag: member="signal.c::sigaddset" ref="gba080a9ab72ac6d079ff0bf8ac9b23f4" args="(sigset_t *set, int sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigaddset </td>
<td>(</td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add a signal to a signal set.
<p>
This service adds the signal number <em>sig</em> to the signal set pointed to by <em>set</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address of a signal set;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>signal to be added to <em>set</em>.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EINVAL, <em>sig</em> is not a valid signal number.</li></ul>
</td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigaddset.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g16efce9e80266d0db1ed9a3ef281ad2b"></a><!-- doxytag: member="signal.c::sigdelset" ref="g16efce9e80266d0db1ed9a3ef281ad2b" args="(sigset_t *set, int sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigdelset </td>
<td>(</td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Delete a signal from a signal set.
<p>
This service remove the signal number <em>sig</em> from the signal set pointed to by <em>set</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address of a signal set;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>signal to be removed from <em>set</em>.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EINVAL, <em>sig</em> is not a valid signal number.</li></ul>
</td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigdelset.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g5925352f90eb589393274fa0376d7def"></a><!-- doxytag: member="signal.c::sigemptyset" ref="g5925352f90eb589393274fa0376d7def" args="(sigset_t *set)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigemptyset </td>
<td>(</td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>set</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Initialize and empty a signal set.
<p>
This service initializes ane empties the signal set pointed to by <em>set</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address of a the signal set to be initialized.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td></td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigemptyset.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g88d7bbc77ea1569ee21c90db549ea023"></a><!-- doxytag: member="signal.c::sigfillset" ref="g88d7bbc77ea1569ee21c90db549ea023" args="(sigset_t *set)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigfillset </td>
<td>(</td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>set</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Initialize and fill a signal set.
<p>
This service initializes ane fills the signal set pointed to by <em>set</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address of a the signal set to be filled.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td></td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigfillset.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g5eaaad0671fbdba01a60ab5b1c8649be"></a><!-- doxytag: member="signal.c::sigismember" ref="g5eaaad0671fbdba01a60ab5b1c8649be" args="(const sigset_t *set, int sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigismember </td>
<td>(</td>
<td class="paramtype">const sigset_t * </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sig</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Test for a signal in a signal set.
<p>
This service tests whether the signal number <em>sig</em> is member of the signal set pointed to by <em>set</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address of a signal set;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>tested signal number.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EINVAL, <em>sig</em> is not a valid signal number.</li></ul>
</td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigismember.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g7b91eecad5998acd6162fde3ab530d7a"></a><!-- doxytag: member="signal.c::sigpending" ref="g7b91eecad5998acd6162fde3ab530d7a" args="(sigset_t *set)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigpending </td>
<td>(</td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"> <em>set</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Examine pending signals.
<p>
This service stores, at the address <em>set</em>, the set of signals that are currently blocked and have been received by the calling thread.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>address where the set of blocked and received signals are stored on success.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EPERM, the calling context is invalid.</li></ul>
</td></tr>
</table>
</dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigpending.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g04cbfbf6045492b2273cc8046cd52d08"></a><!-- doxytag: member="signal.c::sigtimedwait" ref="g04cbfbf6045492b2273cc8046cd52d08" args="(const sigset_t *__restrict__ set, siginfo_t *__restrict__ info, const struct timespec *__restrict__ timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigtimedwait </td>
<td>(</td>
<td class="paramtype">const sigset_t *__restrict__ </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">siginfo_t *__restrict__ </td>
<td class="paramname"> <em>info</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct timespec *__restrict__ </td>
<td class="paramname"> <em>timeout</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Wait during a bounded time for signals.
<p>
This service is equivalent to the <a class="el" href="group__posix__signal.html#gc9043e9dc6fc22bfb82606932bb3b3ed" title="Wait for signals.">sigwaitinfo()</a> service, except that the calling thread is only blocked until the timeout specified by <em>timeout</em> expires.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>set of signals to wait for;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>info</em> </td><td>address where the received <b>siginfo_t</b> object will be stored on success;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>the timeout, expressed as a time interval.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EINVAL, the specified timeout is invalid;</li><li>EPERM, the caller context is invalid;</li><li>EINVAL, a signal in <em>set</em> is not currently blocked;</li><li>EAGAIN, no signal was received and the specified timeout expired.</li></ul>
</td></tr>
</table>
</dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigtimedwait.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gdc0d6eabea5878a70fe1f97b002f5f2a"></a><!-- doxytag: member="signal.c::sigwait" ref="gdc0d6eabea5878a70fe1f97b002f5f2a" args="(const sigset_t *set, int *sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigwait </td>
<td>(</td>
<td class="paramtype">const sigset_t * </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>sig</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Wait for signals.
<p>
This service blocks a Xenomai kernel-space POSIX skin thread until a signal of the set <em>set</em> is received. If a signal in <em>set</em> is not currently blocked by the calling thread, this service returns immediately with an error. The signal received is stored at the address <em>sig</em>.<p>
If a signal of the set <em>set</em> was already pending, it is cleared and this service returns immediately.<p>
Signals are received in priority order, i.e. from SIGRTMIN to SIGRTMAX, then from 1 to SIGRTMIN-1.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>set of signals to wait for;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>sig</em> </td><td>address where the received signal will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EPERM, the caller context is invalid;</li><li>EINVAL, a signal in <em>set</em> is not currently blocked.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigwait.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gc9043e9dc6fc22bfb82606932bb3b3ed"></a><!-- doxytag: member="signal.c::sigwaitinfo" ref="gc9043e9dc6fc22bfb82606932bb3b3ed" args="(const sigset_t *__restrict__ set, siginfo_t *__restrict__ info)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sigwaitinfo </td>
<td>(</td>
<td class="paramtype">const sigset_t *__restrict__ </td>
<td class="paramname"> <em>set</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">siginfo_t *__restrict__ </td>
<td class="paramname"> <em>info</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Wait for signals.
<p>
This service is equivalent to the <a class="el" href="group__posix__signal.html#gdc0d6eabea5878a70fe1f97b002f5f2a" title="Wait for signals.">sigwait()</a> service, except that it returns, at the address <em>info</em>, the <b>siginfo_t</b> object associated with the received signal instead of only returning the signal number.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>set of signals to wait for;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>info</em> </td><td>address where the received <b>siginfo_t</b> object will be stored on success.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>on success; </td></tr>
<tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>with <em>errno</em> set if:<ul>
<li>EPERM, the caller context is invalid;</li><li>EINVAL, a signal in <em>set</em> is not currently blocked.</li></ul>
</td></tr>
</table>
</dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/sigwaitinfo.html">Specification.</a> </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:40 2010 for Xenomai API by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
|