diff options
author | Zack Weinberg <zackw@panix.com> | 2019-08-19 13:51:25 -0400 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-10-30 17:11:10 -0300 |
commit | 2f2c76e1c8d8c4431c6395afeee420b71a4d772a (patch) | |
tree | 6888887c7a717121658d4c99ffb9390ba519b008 /time/sys/time.h | |
parent | 5e46749c64d51f50f8511ed99c1266d7c13e182b (diff) | |
download | glibc-2f2c76e1c8d8c4431c6395afeee420b71a4d772a.tar.gz glibc-2f2c76e1c8d8c4431c6395afeee420b71a4d772a.tar.xz glibc-2f2c76e1c8d8c4431c6395afeee420b71a4d772a.zip |
Make second argument of gettimeofday as 'void *'
Also make the public prototype of gettimeofday declare its second argument with type "void *" unconditionally, consistent with POSIX. It is also consistent with POSIX. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu, and aarch64-linux-gnu. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'time/sys/time.h')
-rw-r--r-- | time/sys/time.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/time/sys/time.h b/time/sys/time.h index f8c946f94e..0473dae339 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -54,23 +54,24 @@ struct timezone int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; - -typedef struct timezone *__restrict __timezone_ptr_t; -#else -typedef void *__restrict __timezone_ptr_t; #endif -/* Get the current time of day and timezone information, - putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. - Returns 0 on success, -1 on errors. - NOTE: This form of timezone information is obsolete. - Use the functions and variables declared in <time.h> instead. */ +/* Get the current time of day, putting it into *TV. + If TZ is not null, *TZ must be a struct timezone, and both fields + will be set to zero. + Calling this function with a non-null TZ is obsolete; + use localtime etc. instead. + This function itself is semi-obsolete; + most callers should use time or clock_gettime instead. */ extern int gettimeofday (struct timeval *__restrict __tv, - __timezone_ptr_t __tz) __THROW __nonnull ((1)); + void *__restrict __tz) __THROW __nonnull ((1)); #ifdef __USE_MISC /* Set the current time of day and timezone information. - This call is restricted to the super-user. */ + This call is restricted to the super-user. + Setting the timezone in this way is obsolete, but we don't yet + warn about it because it still has some uses for which there is + no alternative. */ extern int settimeofday (const struct timeval *__tv, const struct timezone *__tz) __THROW; |