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

gettimeofday.3p (2346B)


  1. '\" et
  2. .TH GETTIMEOFDAY "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. gettimeofday
  12. \(em get the date and time
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/time.h>
  17. .P
  18. int gettimeofday(struct timeval *restrict \fItp\fP, void *restrict \fItzp\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIgettimeofday\fR()
  23. function shall obtain the current time, expressed as seconds and
  24. microseconds since the Epoch, and store it in the
  25. .BR timeval
  26. structure pointed to by
  27. .IR tp .
  28. The resolution of the system clock is unspecified.
  29. .P
  30. If
  31. .IR tzp
  32. is not a null pointer, the behavior is unspecified.
  33. .SH "RETURN VALUE"
  34. The
  35. \fIgettimeofday\fR()
  36. function shall return 0 and no value shall be reserved to indicate
  37. an error.
  38. .SH ERRORS
  39. No errors are defined.
  40. .LP
  41. .IR "The following sections are informative."
  42. .SH EXAMPLES
  43. None.
  44. .SH "APPLICATION USAGE"
  45. Applications should use the
  46. \fIclock_gettime\fR()
  47. function instead of the obsolescent
  48. \fIgettimeofday\fR()
  49. function.
  50. .SH RATIONALE
  51. None.
  52. .SH "FUTURE DIRECTIONS"
  53. The
  54. \fIgettimeofday\fR()
  55. function may be removed in a future version.
  56. .SH "SEE ALSO"
  57. .IR "\fIclock_getres\fR\^(\|)",
  58. .IR "\fIctime\fR\^(\|)"
  59. .P
  60. The Base Definitions volume of POSIX.1\(hy2017,
  61. .IR "\fB<sys_time.h>\fP"
  62. .\"
  63. .SH COPYRIGHT
  64. Portions of this text are reprinted and reproduced in electronic form
  65. from IEEE Std 1003.1-2017, Standard for Information Technology
  66. -- Portable Operating System Interface (POSIX), The Open Group Base
  67. Specifications Issue 7, 2018 Edition,
  68. Copyright (C) 2018 by the Institute of
  69. Electrical and Electronics Engineers, Inc and The Open Group.
  70. In the event of any discrepancy between this version and the original IEEE and
  71. The Open Group Standard, the original IEEE and The Open Group Standard
  72. is the referee document. The original Standard can be obtained online at
  73. http://www.opengroup.org/unix/online.html .
  74. .PP
  75. Any typographical or formatting errors that appear
  76. in this page are most likely
  77. to have been introduced during the conversion of the source files to
  78. man page format. To report such errors, see
  79. https://www.kernel.org/doc/man-pages/reporting_bugs.html .