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

errno.3p (3275B)


  1. '\" et
  2. .TH ERRNO "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. errno
  12. \(em error return value
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <errno.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The lvalue
  20. .IR errno
  21. is used by many functions to return error values.
  22. .P
  23. Many functions provide an error number in
  24. .IR errno ,
  25. which has type
  26. .BR int
  27. and is defined in
  28. .IR <errno.h> .
  29. The value of
  30. .IR errno
  31. shall be defined only after a call to a function for which it is
  32. explicitly stated to be set and until it is changed by the next
  33. function call or if the application assigns it a value. The value of
  34. .IR errno
  35. should only be examined when it is indicated to be valid by a
  36. function's return value. Applications shall obtain the definition of
  37. .IR errno
  38. by the inclusion of
  39. .IR <errno.h> .
  40. No function in this volume of POSIX.1\(hy2017 shall set
  41. .IR errno
  42. to 0. The setting of
  43. .IR errno
  44. after a successful call to a function is unspecified unless the
  45. description of that function specifies that
  46. .IR errno
  47. shall not be modified.
  48. .P
  49. It is unspecified whether
  50. .IR errno
  51. is a macro or an identifier declared with external linkage. If a macro
  52. definition is suppressed in order to access an actual object, or a
  53. program defines an identifier with the name
  54. .IR errno ,
  55. the behavior is undefined.
  56. .P
  57. The symbolic values stored in
  58. .IR errno
  59. are documented in the ERRORS sections on all relevant pages.
  60. .SH "RETURN VALUE"
  61. None.
  62. .SH ERRORS
  63. None.
  64. .LP
  65. .IR "The following sections are informative."
  66. .SH EXAMPLES
  67. None.
  68. .SH "APPLICATION USAGE"
  69. Previously both POSIX and X/Open documents were more restrictive than
  70. the ISO\ C standard in that they required
  71. .IR errno
  72. to be defined as an external variable, whereas the ISO\ C standard required only
  73. that
  74. .IR errno
  75. be defined as a modifiable lvalue with type
  76. .BR int .
  77. .P
  78. An application that needs to examine the value of
  79. .IR errno
  80. to determine the error should set it to 0 before a function call, then
  81. inspect it before a subsequent function call.
  82. .SH RATIONALE
  83. None.
  84. .SH "FUTURE DIRECTIONS"
  85. None.
  86. .SH "SEE ALSO"
  87. .IR "Section 2.3" ", " "Error Numbers"
  88. .P
  89. The Base Definitions volume of POSIX.1\(hy2017,
  90. .IR "\fB<errno.h>\fP"
  91. .\"
  92. .SH COPYRIGHT
  93. Portions of this text are reprinted and reproduced in electronic form
  94. from IEEE Std 1003.1-2017, Standard for Information Technology
  95. -- Portable Operating System Interface (POSIX), The Open Group Base
  96. Specifications Issue 7, 2018 Edition,
  97. Copyright (C) 2018 by the Institute of
  98. Electrical and Electronics Engineers, Inc and The Open Group.
  99. In the event of any discrepancy between this version and the original IEEE and
  100. The Open Group Standard, the original IEEE and The Open Group Standard
  101. is the referee document. The original Standard can be obtained online at
  102. http://www.opengroup.org/unix/online.html .
  103. .PP
  104. Any typographical or formatting errors that appear
  105. in this page are most likely
  106. to have been introduced during the conversion of the source files to
  107. man page format. To report such errors, see
  108. https://www.kernel.org/doc/man-pages/reporting_bugs.html .