poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / gettimeofday.texi
bloba05a448cda87910f40c77c5ceba3e0753bc43629
1 @node gettimeofday
2 @section @code{gettimeofday}
3 @findex gettimeofday
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html}
7 Gnulib module: gettimeofday
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 MSVC 14.
14 @item
15 This function is declared with a nonstandard function prototype (only one
16 argument, or ``...'' after the first argument) on some platforms.
17 @item
18 On some platforms, the second argument has type @code{struct
19 timezone*} rather than @code{void *}, making it an error to redeclare
20 the function with the POSIX signature:
21 glibc.
22 However, rather than penalize these systems with a replacement
23 function, gnulib defines @code{GETTIMEOFDAY_TIMEZONE} to the
24 appropriate type for use in avoiding a compiler warning if assigning
25 @code{gettimeofday} to a function pointer.
26 @item
27 This function has only a precision of 15.6 milliseconds on some platforms:
28 mingw.
29 @end itemize
31 Portability problems not fixed by Gnulib:
32 @itemize
33 @item
34 Behavior is non-portable if the second argument to @code{gettimeofday}
35 is not @code{NULL}.
36 @end itemize