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

exit.3p (3461B)


  1. '\" et
  2. .TH EXIT "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. exit
  12. \(em terminate a process
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. void exit(int \fIstatus\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The value of
  26. .IR status
  27. may be 0, EXIT_SUCCESS, EXIT_FAILURE,
  28. or any other value, though only the least significant 8 bits (that is,
  29. .IR status
  30. & 0377) shall be available from
  31. \fIwait\fR()
  32. and
  33. \fIwaitpid\fR();
  34. the full value shall be available from
  35. \fIwaitid\fR()
  36. and in the
  37. .BR siginfo_t
  38. passed to a signal handler for SIGCHLD.
  39. .P
  40. The
  41. \fIexit\fR()
  42. function shall first call all functions registered by
  43. \fIatexit\fR(),
  44. in the reverse order of their registration, except that a function is
  45. called after any previously registered functions that had already been
  46. called at the time it was registered. Each function is called as many
  47. times as it was registered. If, during the call to any such function, a
  48. call to the
  49. \fIlongjmp\fR()
  50. function is made that would terminate the call to the registered
  51. function, the behavior is undefined.
  52. .P
  53. If a function registered by a call to
  54. \fIatexit\fR()
  55. fails to return, the remaining registered functions shall not be called
  56. and the rest of the
  57. \fIexit\fR()
  58. processing shall not be completed. If
  59. \fIexit\fR()
  60. is called more than once, the behavior is undefined.
  61. .P
  62. The
  63. \fIexit\fR()
  64. function shall then flush all open streams with unwritten buffered data
  65. and close all open streams. Finally, the process shall be terminated
  66. with the same consequences as described in
  67. .IR "Consequences of Process Termination".
  68. .SH "RETURN VALUE"
  69. The
  70. \fIexit\fR()
  71. function does not return.
  72. .SH ERRORS
  73. No errors are defined.
  74. .LP
  75. .IR "The following sections are informative."
  76. .SH EXAMPLES
  77. None.
  78. .SH "APPLICATION USAGE"
  79. None.
  80. .SH RATIONALE
  81. See
  82. \fI_Exit\fR().
  83. .SH "FUTURE DIRECTIONS"
  84. None.
  85. .SH "SEE ALSO"
  86. .IR "\fI_Exit\fR\^(\|)",
  87. .IR "\fIatexit\fR\^(\|)",
  88. .IR "\fIexec\fR\^",
  89. .IR "\fIlongjmp\fR\^(\|)",
  90. .IR "\fItmpfile\fR\^(\|)",
  91. .IR "\fIwait\fR\^(\|)",
  92. .IR "\fIwaitid\fR\^(\|)"
  93. .P
  94. The Base Definitions volume of POSIX.1\(hy2017,
  95. .IR "\fB<stdlib.h>\fP"
  96. .\"
  97. .SH COPYRIGHT
  98. Portions of this text are reprinted and reproduced in electronic form
  99. from IEEE Std 1003.1-2017, Standard for Information Technology
  100. -- Portable Operating System Interface (POSIX), The Open Group Base
  101. Specifications Issue 7, 2018 Edition,
  102. Copyright (C) 2018 by the Institute of
  103. Electrical and Electronics Engineers, Inc and The Open Group.
  104. In the event of any discrepancy between this version and the original IEEE and
  105. The Open Group Standard, the original IEEE and The Open Group Standard
  106. is the referee document. The original Standard can be obtained online at
  107. http://www.opengroup.org/unix/online.html .
  108. .PP
  109. Any typographical or formatting errors that appear
  110. in this page are most likely
  111. to have been introduced during the conversion of the source files to
  112. man page format. To report such errors, see
  113. https://www.kernel.org/doc/man-pages/reporting_bugs.html .