logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

sigsetjmp.3p (4225B)


  1. '\" et
  2. .TH SIGSETJMP "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. sigsetjmp
  12. \(em set jump point for a non-local goto
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <setjmp.h>
  17. .P
  18. int sigsetjmp(sigjmp_buf \fIenv\fP, int \fIsavemask\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIsigsetjmp\fR()
  23. function shall be equivalent to the
  24. \fIsetjmp\fR()
  25. function, except as follows:
  26. .IP " *" 4
  27. References to
  28. \fIsetjmp\fR()
  29. are equivalent to
  30. \fIsigsetjmp\fR().
  31. .IP " *" 4
  32. References to
  33. \fIlongjmp\fR()
  34. are equivalent to
  35. \fIsiglongjmp\fR().
  36. .IP " *" 4
  37. If the value of the
  38. .IR savemask
  39. argument is not 0,
  40. \fIsigsetjmp\fR()
  41. shall also save the current signal mask of the calling thread as part
  42. of the calling environment.
  43. .SH "RETURN VALUE"
  44. If the return is from a successful direct invocation,
  45. \fIsigsetjmp\fR()
  46. shall return 0. If the return is from a call to
  47. \fIsiglongjmp\fR(),
  48. \fIsigsetjmp\fR()
  49. shall return a non-zero value.
  50. .SH ERRORS
  51. No errors are defined.
  52. .LP
  53. .IR "The following sections are informative."
  54. .SH EXAMPLES
  55. None.
  56. .SH "APPLICATION USAGE"
  57. The distinction between
  58. \fIsetjmp\fR()/\c
  59. \fIlongjmp\fR()
  60. and
  61. \fIsigsetjmp\fR()/\c
  62. \fIsiglongjmp\fR()
  63. is only significant for programs which use
  64. \fIsigaction\fR(),
  65. \fIsigprocmask\fR(),
  66. or
  67. \fIsigsuspend\fR().
  68. .P
  69. Note that since this function is defined in terms of
  70. \fIsetjmp\fR(),
  71. if
  72. .IR savemask
  73. is zero, it is unspecified whether the signal mask is saved.
  74. .SH RATIONALE
  75. The ISO\ C standard specifies various restrictions on the usage of the
  76. \fIsetjmp\fR()
  77. macro in order to permit implementors to recognize the name in the
  78. compiler and not implement an actual function. These same restrictions
  79. apply to the
  80. \fIsigsetjmp\fR()
  81. macro.
  82. .P
  83. There are processors that cannot easily support these calls, but this
  84. was not considered a sufficient reason to exclude them.
  85. .P
  86. 4.2 BSD, 4.3 BSD, and XSI-conformant systems provide functions named
  87. \fI_setjmp\fR()
  88. and
  89. \fI_longjmp\fR()
  90. that, together with
  91. \fIsetjmp\fR()
  92. and
  93. \fIlongjmp\fR(),
  94. provide the same functionality as
  95. \fIsigsetjmp\fR()
  96. and
  97. \fIsiglongjmp\fR().
  98. On those systems,
  99. \fIsetjmp\fR()
  100. and
  101. \fIlongjmp\fR()
  102. save and restore signal masks, while
  103. \fI_setjmp\fR()
  104. and
  105. \fI_longjmp\fR()
  106. do not. On System V Release 3
  107. and in corresponding issues of the SVID,
  108. \fIsetjmp\fR()
  109. and
  110. \fIlongjmp\fR()
  111. are explicitly defined not to save and restore signal masks. In order
  112. to permit existing practice in both cases, the relation of
  113. \fIsetjmp\fR()
  114. and
  115. \fIlongjmp\fR()
  116. to signal masks is not specified, and a new set of functions is defined
  117. instead.
  118. .P
  119. The
  120. \fIlongjmp\fR()
  121. and
  122. \fIsiglongjmp\fR()
  123. functions operate as in the previous issue provided the matching
  124. \fIsetjmp\fR()
  125. or
  126. \fIsigsetjmp\fR()
  127. has been performed in the same thread. Non-local jumps into contexts
  128. saved by other threads would be at best a questionable practice and
  129. were not considered worthy of standardization.
  130. .SH "FUTURE DIRECTIONS"
  131. None.
  132. .SH "SEE ALSO"
  133. .IR "\fIpthread_sigmask\fR\^(\|)",
  134. .IR "\fIsiglongjmp\fR\^(\|)",
  135. .IR "\fIsignal\fR\^(\|)",
  136. .IR "\fIsigsuspend\fR\^(\|)"
  137. .P
  138. The Base Definitions volume of POSIX.1\(hy2017,
  139. .IR "\fB<setjmp.h>\fP"
  140. .\"
  141. .SH COPYRIGHT
  142. Portions of this text are reprinted and reproduced in electronic form
  143. from IEEE Std 1003.1-2017, Standard for Information Technology
  144. -- Portable Operating System Interface (POSIX), The Open Group Base
  145. Specifications Issue 7, 2018 Edition,
  146. Copyright (C) 2018 by the Institute of
  147. Electrical and Electronics Engineers, Inc and The Open Group.
  148. In the event of any discrepancy between this version and the original IEEE and
  149. The Open Group Standard, the original IEEE and The Open Group Standard
  150. is the referee document. The original Standard can be obtained online at
  151. http://www.opengroup.org/unix/online.html .
  152. .PP
  153. Any typographical or formatting errors that appear
  154. in this page are most likely
  155. to have been introduced during the conversion of the source files to
  156. man page format. To report such errors, see
  157. https://www.kernel.org/doc/man-pages/reporting_bugs.html .