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

gmtime.3p (4484B)


  1. '\" et
  2. .TH GMTIME "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. gmtime,
  12. gmtime_r
  13. \(em convert a time value to a broken-down UTC time
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <time.h>
  18. .P
  19. struct tm *gmtime(const time_t *\fItimer\fP);
  20. struct tm *gmtime_r(const time_t *restrict \fItimer\fP,
  21. struct tm *restrict \fIresult\fP);
  22. .fi
  23. .SH DESCRIPTION
  24. For
  25. \fIgmtime\fR():
  26. The functionality described on this reference page is aligned with the
  27. ISO\ C standard. Any conflict between the requirements described here and the
  28. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  29. .P
  30. The
  31. \fIgmtime\fR()
  32. function shall convert the time in seconds since the Epoch pointed to by
  33. .IR timer
  34. into a broken-down time, expressed as Coordinated Universal Time
  35. (UTC).
  36. .P
  37. The relationship between a time in seconds since the Epoch used as an
  38. argument to
  39. \fIgmtime\fR()
  40. and the
  41. .BR tm
  42. structure (defined in the
  43. .IR <time.h>
  44. header) is that the result shall be as specified in the expression
  45. given in the definition of seconds since the Epoch (see the Base Definitions volume of POSIX.1\(hy2017,
  46. .IR "Section 4.16" ", " "Seconds Since the Epoch"),
  47. where the names in the structure and in the expression correspond.
  48. .P
  49. The same relationship shall apply for
  50. \fIgmtime_r\fR().
  51. .P
  52. The
  53. \fIgmtime\fR()
  54. function need not be thread-safe.
  55. .P
  56. The
  57. \fIasctime\fR(),
  58. \fIctime\fR(),
  59. \fIgmtime\fR(),
  60. and
  61. \fIlocaltime\fR()
  62. functions shall return values in one of two static objects: a
  63. broken-down time structure and an array of type
  64. .BR char .
  65. Execution of any of the functions may overwrite the information
  66. returned in either of these objects by any of the other functions.
  67. .P
  68. The
  69. \fIgmtime_r\fR()
  70. function shall convert the time in seconds since the Epoch pointed to by
  71. .IR timer
  72. into a broken-down time expressed as Coordinated Universal Time (UTC).
  73. The broken-down time is stored in the structure referred to by
  74. .IR result .
  75. The
  76. \fIgmtime_r\fR()
  77. function shall also return the address of the same structure.
  78. .SH "RETURN VALUE"
  79. Upon successful completion, the
  80. \fIgmtime\fR()
  81. function shall return a pointer to a
  82. .BR "struct tm" .
  83. If an error is detected,
  84. \fIgmtime\fR()
  85. shall return a null pointer
  86. and set
  87. .IR errno
  88. to indicate the error.
  89. .P
  90. Upon successful completion,
  91. \fIgmtime_r\fR()
  92. shall return the address of the structure pointed to by the argument
  93. .IR result .
  94. If an error is detected,
  95. \fIgmtime_r\fR()
  96. shall return a null pointer and set
  97. .IR errno
  98. to indicate the error.
  99. .SH ERRORS
  100. The
  101. \fIgmtime\fR()
  102. and
  103. \fIgmtime_r\fR()
  104. functions shall fail if:
  105. .TP
  106. .BR EOVERFLOW
  107. The result cannot be represented.
  108. .LP
  109. .IR "The following sections are informative."
  110. .SH EXAMPLES
  111. None.
  112. .SH "APPLICATION USAGE"
  113. The
  114. \fIgmtime_r\fR()
  115. function is thread-safe and returns values in a user-supplied buffer
  116. instead of possibly using a static data area that may be overwritten by
  117. each call.
  118. .SH RATIONALE
  119. None.
  120. .SH "FUTURE DIRECTIONS"
  121. None.
  122. .SH "SEE ALSO"
  123. .IR "\fIasctime\fR\^(\|)",
  124. .IR "\fIclock\fR\^(\|)",
  125. .IR "\fIctime\fR\^(\|)",
  126. .IR "\fIdifftime\fR\^(\|)",
  127. .IR "\fIlocaltime\fR\^(\|)",
  128. .IR "\fImktime\fR\^(\|)",
  129. .IR "\fIstrftime\fR\^(\|)",
  130. .IR "\fIstrptime\fR\^(\|)",
  131. .IR "\fItime\fR\^(\|)",
  132. .IR "\fIutime\fR\^(\|)"
  133. .P
  134. The Base Definitions volume of POSIX.1\(hy2017,
  135. .IR "Section 4.16" ", " "Seconds Since the Epoch",
  136. .IR "\fB<time.h>\fP"
  137. .\"
  138. .SH COPYRIGHT
  139. Portions of this text are reprinted and reproduced in electronic form
  140. from IEEE Std 1003.1-2017, Standard for Information Technology
  141. -- Portable Operating System Interface (POSIX), The Open Group Base
  142. Specifications Issue 7, 2018 Edition,
  143. Copyright (C) 2018 by the Institute of
  144. Electrical and Electronics Engineers, Inc and The Open Group.
  145. In the event of any discrepancy between this version and the original IEEE and
  146. The Open Group Standard, the original IEEE and The Open Group Standard
  147. is the referee document. The original Standard can be obtained online at
  148. http://www.opengroup.org/unix/online.html .
  149. .PP
  150. Any typographical or formatting errors that appear
  151. in this page are most likely
  152. to have been introduced during the conversion of the source files to
  153. man page format. To report such errors, see
  154. https://www.kernel.org/doc/man-pages/reporting_bugs.html .