summaryrefslogtreecommitdiff
path: root/tests/test-gettimeofday.c
Commit message (Collapse)AuthorAgeFilesLines
* gettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.Bruno Haible2023-03-081-1/+2
| | | | | | | * modules/gettimeofday-tests (Depends-on): Add 'time'. * modules/timespec_get-tests (Depends-on): Likewise. * tests/test-gettimeofday.c (test_consistency): Update comment. * tests/test-timespec_get.c (main): Likewise.
* gettimeofday tests: Enhance test.Bruno Haible2023-03-081-4/+44
| | | | | | | | * tests/test-gettimeofday.c: Include <stdlib.h> and macros.h. (test_clobber): New function, extracted from main. (test_consistency): New function, based on tests/test-timespec_get.c. (main): Invoke both functions. * modules/gettimeofday-tests (Files): Add macros.h.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* gettimeofday: expose type of second argumentEric Blake2010-02-041-5/+3
| | | | | | | | | | | | | | | Needed to silence compiler warnings such as: test-gettimeofday.c:23: warning: initialization from incompatible pointer type based on whether gettimeofday complies with POSIX or provides the extension of struct timezone. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Do better detection of glibc extension signature, and define GETTIMEOFDAY_TIMEZONE. * tests/test-gettimeofday.c: Use it to silence warning. * doc/posix-functions/gettimeofday.texi (gettimeofday): Document the issue. Signed-off-by: Eric Blake <ebb9@byu.net>
* maint: normalize copyright noticesJim Meyering2010-01-271-1/+1
| | | | | | | | Normalize some copyright comments: change the two spaces before "Free Software..." to one: git grep -l -E '[0-9]{4} *Free Software' \ | xargs perl -pi -e 's/ +(Free Software)/ $1/'
* Fix copyright statement.Simon Josefsson2010-01-271-1/+1
|
* tests: add signature checksEric Blake2009-12-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests will help catch problems similar to the one recently fixed for cygwin declaring getsubopt and symlinkat in the wrong header. * tests/signature.h (SIGNATURE_CHECK): New file. * modules/atexit-tests (Files): Use it. * modules/btowc-tests (Files): Likewise. * modules/canonicalize-lgpl-tests (Files): Likewise. * modules/ceilf-tests (Files): Likewise. * modules/ceill-tests (Files): Likewise. * modules/chown-tests (Files): Likewise. * modules/dprintf-posix-tests (Files): Likewise. * modules/dup2-tests (Files): Likewise. * modules/dup3-tests (Files): Likewise. * modules/duplocale-tests (Files): Likewise. * modules/fchdir-tests (Files): Likewise. * modules/fcntl-tests (Files): Likewise. * modules/fdopendir-tests (Files): Likewise. * modules/fflush-tests (Files): Likewise. * modules/flock-tests (Files): Likewise. * modules/floorf-tests (Files): Likewise. * modules/floorl-tests (Files): Likewise. * modules/fnmatch-tests (Files): Likewise. * modules/fopen-tests (Files): Likewise. * modules/fprintf-posix-tests (Files): Likewise. * modules/freopen-tests (Files): Likewise. * modules/frexp-nolibm-tests (Files): Likewise. * modules/frexp-tests (Files): Likewise. * modules/frexpl-nolibm-tests (Files): Likewise. * modules/frexpl-tests (Files): Likewise. * modules/fseek-tests (Files): Likewise. * modules/fseeko-tests (Files): Likewise. * modules/fsync-tests (Files): Likewise. * modules/ftell-tests (Files): Likewise. * modules/ftello-tests (Files): Likewise. * modules/futimens-tests (Files): Likewise. * modules/getaddrinfo-tests (Files): Likewise. * modules/getcwd-tests (Files): Likewise. * modules/getdelim-tests (Files): Likewise. * modules/getdtablesize-tests (Files): Likewise. * modules/getgroups-tests (Files): Likewise. * modules/gethostname-tests (Files): Likewise. * modules/getline-tests (Files): Likewise. * modules/getopt-posix-tests (Files): Likewise. * modules/gettimeofday-tests (Files): Likewise. * modules/glob-tests (Files): Likewise. * modules/iconv-tests (Files): Likewise. * modules/inet_ntop-tests (Files): Likewise. * modules/inet_pton-tests (Files): Likewise. * modules/isblank-tests (Files): Likewise. * modules/lchown-tests (Files): Likewise. * modules/ldexpl-tests (Files): Likewise. * modules/link-tests (Files): Likewise. * modules/linkat-tests (Files): Likewise. * modules/lseek-tests (Files): Likewise. * modules/lstat-tests (Files): Likewise. * modules/mbrtowc-tests (Files): Likewise. * modules/mbsinit-tests (Files): Likewise. * modules/mbsnrtowcs-tests (Files): Likewise. * modules/mbsrtowcs-tests (Files): Likewise. * modules/memchr-tests (Files): Likewise. * modules/memcmp-tests (Files): Likewise. * modules/memmem-tests (Files): Likewise. * modules/memrchr-tests (Files): Likewise. * modules/mkdir-tests (Files): Likewise. * modules/mkfifo-tests (Files): Likewise. * modules/mkfifoat-tests (Files): Likewise. * modules/mknod-tests (Files): Likewise. * modules/nanosleep-tests (Files): Likewise. * modules/nl_langinfo-tests (Files): Likewise. * modules/obstack-printf-tests (Files): Likewise. * modules/open-tests (Files): Likewise. * modules/openat-tests (Files): Likewise. * modules/perror-tests (Files): Likewise. * modules/pipe2-tests (Files): Likewise. * modules/poll-tests (Files): Likewise. * modules/popen-tests (Files): Likewise. * modules/posix_spawn-tests (Files): Likewise. * modules/posix_spawnp-tests (Files): Likewise. * modules/pread-tests (Files): Likewise. * modules/printf-posix-tests (Files): Likewise. * modules/pty-tests (Files): Likewise. * modules/random_r-tests (Files): Likewise. * modules/rawmemchr-tests (Files): Likewise. * modules/readlink-tests (Files): Likewise. * modules/remove-tests (Files): Likewise. * modules/rename-tests (Files): Likewise. * modules/renameat-tests (Files): Likewise. * modules/rmdir-tests (Files): Likewise. * modules/round-tests (Files): Likewise. * modules/roundf-tests (Files): Likewise. * modules/roundl-tests (Files): Likewise. * modules/select-tests (Files): Likewise. * modules/setenv-tests (Files): Likewise. * modules/sigaction-tests (Files): Likewise. * modules/sleep-tests (Files): Likewise. * modules/snprintf-posix-tests (Files): Likewise. * modules/snprintf-tests (Files): Likewise. * modules/sprintf-posix-tests (Files): Likewise. * modules/stat-tests (Files): Likewise. * modules/strcasestr-tests (Files): Likewise. * modules/strchrnul-tests (Files): Likewise. * modules/strerror-tests (Files): Likewise. * modules/strsignal-tests (Files): Likewise. * modules/strstr-tests (Files): Likewise. * modules/strtod-tests (Files): Likewise. * modules/strverscmp-tests (Files): Likewise. * modules/symlink-tests (Files): Likewise. * modules/symlinkat-tests (Files): Likewise. * modules/times-tests (Files): Likewise. * modules/trunc-tests (Files): Likewise. * modules/truncf-tests (Files): Likewise. * modules/truncl-tests (Files): Likewise. * modules/tsearch-tests (Files): Likewise. * modules/uname-tests (Files): Likewise. * modules/unlink-tests (Files): Likewise. * modules/unsetenv-tests (Files): Likewise. * modules/usleep-tests (Files): Likewise. * modules/utimensat-tests (Files): Likewise. * modules/vasprintf-tests (Files): Likewise. * modules/vdprintf-posix-tests (Files): Likewise. * modules/vfprintf-posix-tests (Files): Likewise. * modules/vprintf-posix-tests (Files): Likewise. * modules/vsnprintf-posix-tests (Files): Likewise. * modules/vsnprintf-tests (Files): Likewise. * modules/vsprintf-posix-tests (Files): Likewise. * modules/wcrtomb-tests (Files): Likewise. * modules/wcsnrtombs-tests (Files): Likewise. * modules/wcsrtombs-tests (Files): Likewise. * modules/wcwidth-tests (Files): Likewise. * tests/test-isfinite.c (isfinite): Ensure macro declaration. * tests/test-isinf.c (isinf): Likewise. * tests/test-isnan.c (isnan): Likewise. * tests/test-signbit.c (signbit): Likewise. * tests/test-select.c (FD_CLR, FD_ISSET, FD_SET, FD_ZERO): Ensure declaration, either as macro or with correct signature. (select): Ensure function under test is declared with correct signature in correct header. * tests/test-atexit.c (atexit): Likewise. * tests/test-btowc.c (btowc): Likewise. * tests/test-canonicalize-lgpl.c (realpath) (canonicalize_file_name): Likewise. * tests/test-ceilf1.c (ceilf): Likewise. * tests/test-ceill.c (ceill): Likewise. * tests/test-chown.c (chown): Likewise. * tests/test-dprintf-posix.c (dprintf): Likewise. * tests/test-dup2.c (dup2): Likewise. * tests/test-dup3.c (dup3): Likewise. * tests/test-duplocale.c (duplocale): Likewise. * tests/test-fchdir.c (fchdir): Likewise. * tests/test-fchownat.c (fchownat): Likewise. * tests/test-fcntl.c (fcntl): Likewise. * tests/test-fdopendir.c (fdopendir): Likewise. * tests/test-fflush.c (fflush): Likewise. * tests/test-flock.c (flock): Likewise. * tests/test-floorf1.c (floorf): Likewise. * tests/test-floorl.c (floorl): Likewise. * tests/test-fnmatch.c (fnmatch): Likewise. * tests/test-fopen.c (fopen): Likewise. * tests/test-fprintf-posix.c (fprintf): Likewise. * tests/test-freopen.c (freopen): Likewise. * tests/test-frexp.c (frexp): Likewise. * tests/test-frexpl.c (frexpl): Likewise. * tests/test-fseek.c (fseek): Likewise. * tests/test-fseeko.c (fseeko): Likewise. * tests/test-fstatat.c (fstatat): Likewise. * tests/test-fsync.c (fsync): Likewise. * tests/test-ftell.c (ftell): Likewise. * tests/test-ftello.c (ftello): Likewise. * tests/test-futimens.c (futimens): Likewise. * tests/test-getaddrinfo.c (getaddrinfo, freeaddrinfo) (gai_strerror): Likewise. * tests/test-getcwd.c (getcwd): Likewise. * tests/test-getdelim.c (getdelim): Likewise. * tests/test-getdtablesize.c (getdtablesize): Likewise. * tests/test-getgroups.c (getgroups): Likewise. * tests/test-gethostname.c (gethostname): Likewise. * tests/test-getline.c (getline): Likewise. * tests/test-getopt.c (getopt, getopt_long, getopt_long_only): Likewise. * tests/test-gettimeofday.c (gettimeofday): Likewise. * tests/test-glob.c (glob, globfree): Likewise. * tests/test-iconv.c (iconv, iconv_open, iconv_close): Likewise. * tests/test-inet_ntop.c (inet_ntop): Likewise. * tests/test-inet_pton.c (inet_pton): Likewise. * tests/test-isblank.c (isblank): Likewise. * tests/test-lchown.c (lchown): Likewise. * tests/test-ldexpl.c (ldexpl): Likewise. * tests/test-link.c (link): Likewise. * tests/test-linkat.c (linkat): Likewise. * tests/test-lseek.c (lseek): Likewise. * tests/test-lstat.c (lstat): Likewise. * tests/test-mbrtowc.c (mbrtowc): Likewise. * tests/test-mbsinit.c (mbsinit): Likewise. * tests/test-mbsnrtowcs.c (mbsnrtowcs): Likewise. * tests/test-mbsrtowcs.c (mbsrtowcs): Likewise. * tests/test-memchr.c (memchr): Likewise. * tests/test-memcmp.c (memcmp): Likewise. * tests/test-memmem.c (memmem): Likewise. * tests/test-memrchr.c (memrchr): Likewise. * tests/test-mkdir.c (mkdir): Likewise. * tests/test-mkdirat.c (mkdirat): Likewise. * tests/test-mkfifo.c (mkfifo): Likewise. * tests/test-mkfifoat.c (mkfifoat, mknodat): Likewise. * tests/test-mknod.c (mknod): Likewise. * tests/test-nanosleep.c (nanosleep): Likewise. * tests/test-nl_langinfo.c (nl_langinfo): Likewise. * tests/test-obstack-printf.c (obstack_printf, obstack_vprintf): Likewise. * tests/test-open.c (open): Likewise. * tests/test-openat.c (openat): Likewise. * tests/test-perror.c (perror): Likewise. * tests/test-pipe2.c (pipe2): Likewise. * tests/test-poll.c (poll): Likewise. * tests/test-popen.c (popen, pclose): Likewise. * tests/test-posix_spawn1.c (posix_spawnp, posix_spawnattr_init) (posix_spawnattr_destroy, posix_spawnattr_setsigmask) (posix_spawnattr_setflags, posix_spawn_file_actions_init) (posix_spawn_file_actions_destroy) (posix_spawn_file_actions_addclose) (posix_spawn_file_actions_addopen) (posix_spawn_file_actions_adddup2): Likewise. * tests/test-posix_spawn3.c (posix_spawn): Likewise. * tests/test-pread.c (pread): Likewise. * tests/test-printf-posix.c (printf): Likewise. * tests/test-pty.c (openpty, forkpty): Likewise. * tests/test-random_r.c (srandom_r, initstate_r, setstate_r) (random_r): Likewise. * tests/test-rawmemchr.c (rawmemchr): Likewise. * tests/test-readlink.c (readlink): Likewise. * tests/test-remove.c (remove): Likewise. * tests/test-rename.c (rename): Likewise. * tests/test-renameat.c (renameat): Likewise. * tests/test-rmdir.c (rmdir): Likewise. * tests/test-round1.c (round): Likewise. * tests/test-roundf1.c (roundf): Likewise. * tests/test-roundl.c (roundl): Likewise. * tests/test-setenv.c (setenv): Likewise. * tests/test-sigaction.c (sigaction): Likewise. * tests/test-sleep.c (sleep): Likewise. * tests/test-snprintf.c (snprintf): Likewise. * tests/test-sprintf-posix.c (sprintf): Likewise. * tests/test-stat.c (stat): Likewise. * tests/test-stpncpy.c (stpncpy): Likewise. * tests/test-strcasestr.c (strcasestr): Likewise. * tests/test-strchrnul.c (strchrnul): Likewise. * tests/test-strerror.c (strerror): Likewise. * tests/test-strsignal.c (strsignal): Likewise. * tests/test-strstr.c (strstr): Likewise. * tests/test-strtod.c (strtod): Likewise. * tests/test-strverscmp.c (strverscmp): Likewise. * tests/test-symlink.c (symlink): Likewise. * tests/test-symlinkat.c (symlinkat, readlinkat): Likewise. * tests/test-times.c (times): Likewise. * tests/test-trunc1.c (trunc): Likewise. * tests/test-truncf1.c (truncf): Likewise. * tests/test-truncl.c (truncl): Likewise. * tests/test-tsearch.c (tdelete, tfind, tsearch, twalk): Likewise. * tests/test-uname.c (uname): Likewise. * tests/test-unlink.c (unlink): Likewise. * tests/test-unlinkat.c (unlinkat): Likewise. * tests/test-unsetenv.c (unsetenv): Likewise. * tests/test-usleep.c (usleep): Likewise. * tests/test-utimensat.c (utimensat): Likewise. * tests/test-vasprintf.c (asprintf, vasprintf): Likewise. * tests/test-vdprintf-posix.c (vdprintf): Likewise. * tests/test-vfprintf-posix.c (vfprintf): Likewise. * tests/test-vprintf-posix.c (vprintf): Likewise. * tests/test-vsnprintf.c (vsnprintf): Likewise. * tests/test-vsprintf-posix.c (vsprintf): Likewise. * tests/test-wcrtomb.c (wcrtomb): Likewise. * tests/test-wcsnrtombs.c (wcsnrtombs): Likewise. * tests/test-wcsrtombs.c (wcsrtombs): Likewise. * tests/test-wcwidth.c (wcwidth): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* tests: avoid several compiler warningsEric Blake2009-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-getcwd.c (main): Avoid buffer underflow. * tests/test-getdate.c (main): String literals are not safe with putenv, so use setenv. Declare unused argument. * modules/getdate-tests (Depends-on): Add setenv. * tests/test-argv-iter.c (main): Declare unused argument. Avoid problems with string literals in char *. * tests/test-hash.c (main): Avoid shadowing declaration. (insert_new): Treat string literals as char const *. * tests/test-getopt.h (test_getopt): Likewise. (getopt_loop): Alter types to minimize casting elsewhere. * tests/test-getopt_long.h (test_getopt_long, getopt_long_loop) (test_getopt_long_posix): Likewise. (do_getopt_long): Add wrapper to minimize casting. * tests/test-atexit.c (clear_temp_file): Use void. * tests/test-areadlink-with-size.c (main): Declare unused arguments. * tests/test-areadlink.c (main): Likewise. * tests/test-areadlinkat-with-size.c (main): Likewise. * tests/test-areadlinkat.c (main): Likewise. * tests/test-canonicalize-lgpl.c (main): Likewise. * tests/test-canonicalize.c (main): Likewise. * tests/test-dirent-safer.c (main): Likewise. * tests/test-dirname.c (main): Likewise. * tests/test-dup2.c (main): Likewise. * tests/test-fchdir.c (main): Likewise. * tests/test-fcntl-h.c (main): Likewise. * tests/test-fcntl-safer.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-fdutimensat.c (main): Likewise. * tests/test-fflush.c (main): Likewise. * tests/test-filenamecat.c (main): Likewise. * tests/test-filevercmp.c (main): Likewise. * tests/test-fopen-safer.c (main): Likewise. * tests/test-fopen.c (main): Likewise. * tests/test-fpending.c (main): Likewise. * tests/test-fpurge.c (main): Likewise. * tests/test-freading.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-fsync.c (main): Likewise. * tests/test-futimens.c (main): Likewise. * tests/test-getndelim2.c (main): Likewise. * tests/test-gettimeofday.c (main): Likewise. * tests/test-getopt.c (main): Likewise. * tests/test-i-ring.c (main): Likewise. * tests/test-inttypes.c (main): Likewise. * tests/test-link.c (main): Likewise. * tests/test-lstat.c (main): Likewise. * tests/test-math.c (main): Likewise. * tests/test-md5.c (main): Likewise. * tests/test-memchr2.c (main): Likewise. * tests/test-memrchr.c (main): Likewise. * tests/test-mkdir.c (main): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-mkfifoat.c (main): Likewise. * tests/test-open.c (main): Likewise. * tests/test-openat-safer.c (main): Likewise. * tests/test-openat.c (main): Likewise. * tests/test-quotearg.c (main): Likewise. * tests/test-rawmemchr.c (main): Likewise. * tests/test-readlink.c (main): Likewise. * tests/test-remove.c (main): Likewise. * tests/test-rename.c (main): Likewise. * tests/test-renameat.c (main): Likewise. * tests/test-rmdir.c (main): Likewise. * tests/test-sha1.c (main): Likewise. * tests/test-signal.c (main): Likewise. * tests/test-sigaction.c (main): Likewise. * tests/test-stat.c (main): Likewise. * tests/test-stat-time.c (main): Likewise. * tests/test-stddef.c (main): Likewise. * tests/test-stdint.c (main): Likewise. * tests/test-stdio.c (main): Likewise. * tests/test-stdlib.c (main): Likewise. * tests/test-strchrnul.c (main): Likewise. * tests/test-strerror.c (main): Likewise. * tests/test-string.c (main): Likewise. * tests/test-strtod.c (main): Likewise. * tests/test-strverscmp.c (main): Likewise. * tests/test-symlink.c (main): Likewise. * tests/test-symlinkat.c (main): Likewise. * tests/test-sys_stat.c (main): Likewise. * tests/test-sys_time.c (main): Likewise. * tests/test-time.c (main): Likewise. * tests/test-unistd.c (main): Likewise. * tests/test-unlink.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-utimens.c (main): Likewise. * tests/test-utimensat.c (main): Likewise. * tests/test-version-etc.c (main): Likewise. * tests/test-wchar.c (main): Likewise. * tests/test-wctype.c (main): Likewise. * tests/test-xprintf-posix.c (main): Likewise. * tests/test-posixtm.c (main): Likewise. (STREQ): Delete unused macro. * tests/test-linkat.c (main): Declare unused arguments. Avoid shadowed variables. * tests/test-memchr.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-6/+4
|
* Make it compile again. suseconds_t does not exist on Cygwin.Bruno Haible2007-01-191-2/+1
|
* * MODULES.html.sh (Support for systems lacking POSIX:2001): NewPaul Eggert2007-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | module sys_time. * lib/gethrxtime.c: Include <sys/time.h>, since we can no longer assume timespec.h defines struct timeval. * lib/settime.c: Likewise. * lib/utimens.c: Likewise. * lib/gettime.c (gettime): Remove test against HAVE_GETTIMEOFDAY, since we now assume the gettimeofday module. * lib/tempname.c (__gen_tempname): Likewise. * lib/gettimeofday.h: Remove. * lib/gettimeofday.c: Include <sys/time.h> instead of "gettimeofday.h". Don't include <sys/types.h> and <stdlib.h>; shouldn't be needed. Include <time.h>, for 'time()'. (localtime_buffer_addr): Also use this workaround if TZSET_CLOBBERS_LOCALTIME. Set to a dummy static variable by default, to simplify the uses. All uses changed. (localtime, gmtime, tzset, gettimeofday): Reformat slightly so that #undef is inside {}, and 'const' follows type name consistently. (tzset): Define replacement only if TZSET_CLOBBERS_LOCALTIME. (gettimeofday): Do not use the maximum possible value for tv->tv_usec, since that might break usages other than ls.c. Instead, we'll leave ls.c alone. This undoes today's patch by Bruno. Add a compile-time warning for 1s-clock resolution; we've never observed the problem but might as well keep the canary. * lib/nanosleep.c: Include timespec.h first, for interface check. * lib/nanosleep.c: Include <sys/time.h> unconditionally, since we now assume the sys_time module. * lib/tempname.c: Likewise. * lib/timespec.h: Likewise. * lib/nanosleep.c: Don't worry about TIME_WITH_SYS_TIME; no longer needed. * lib/strftime.c: Likewise. * lib/timespec.h: Likewise. * lib/posixtm.c: Include posixtm.h first, for interface check. Don't worry about TM_IN_SYS_TIME; that's wayyy obsolete. * lib/posixtm.h: Include stdbool.h and time.h, for proper interface. * lib/strftime.c: Don't include <sys/types.h>; shouldn't be needed. * lib/sys_time_.h: New file. * lib/timespec.h (struct timespec): Use long int, not long. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): (gl_FUNC_GETTIMEOFDAY_CLOBBER, gl_PREREQ_GETTIMEOFDAY): Remove obsolescent call to AC_HEADER_TIME. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/strftime.m4 (gl_FUNC_STRFTIME): Likewise. * m4/timespec.m4 (gl_TIMESPEC, gl_CHECK_TYPE_STRUCT_TIMESPEC): Likewise. * m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Likewise. * m4/utimbuf.m4 (gl_CHECK_TYPE_STRUCT_UTIMBUF): Likewise. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Move sys/time.h tests into the sys_time module. Check for gettimeofday just once. Prefix our variables with gl_, not with ac_ or jm_. Tighten test for gettimeofday signature to just check the signature. Merely compile it, since linking doesn't test signature. Improve test for whether gettimeofday.o is actually needed. (gl_FUNC_GETTIMEOFDAY_CLOBBER): Renamed from AC_FUNC_GETTIMEOFDAY_CLOBBER. All uses changed. Use AC_RUN_IFELSE rather than AC_TRY_RUN. If clobbering, set and define GETTIMEOFDAY_CLOBBERS_LOCALTIME. (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Don't define GETTIMEOFDAY_CLOBBERS_LOCALTIME; that's gl_FUNC_GETTIMEOFDAY_CLOBBER's job. Don't define tzset; that's gl_FUNC_TZSET_CLOBBER's job. * m4/mktime.m4 (AC_FUNC_MKTIME): Just include <time.h> rather than worrying about sys/time.h. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Don't bother worrying about TIME_WITH_SYS_TIME. * m4/stat-time.m4 (gl_STAT_TIME): Likewise. * m4/posixtm.m4 (gl_POSIXTM): Remove obsolescent call to AC_STRUCT_TM. * m4/sys_time_h.m4: New file. * m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Require gl_HEADER_SYS_TIME_H. Don't include sys/time.h. Return from main rather than exiting. Define TZSET_CLOBBERS_LOCALTIME, for consistency with other names; all uses changed. * modules/gethrxtime (Depends-on): Add sys_time. * modules/gettime (Depends-on): Likewise. * modules/gettimeofday (Depends-on): Likewise. * modules/nanosleep (Depends-on): Likewise. * modules/settime (Depends-on): Likewise. * modules/tempname (Depends-on): Likewise. * modules/utimens (Depends-on): Likewise. * modules/gettimeofday (Files): Remove lib/gettimeofday.h. (Include:) Change back to <sys/time.h>. (Maintainer:) Add self. * modules/sys_time: New file. * modules/tempname (Depends-on): Add gettimeofday. * tests/test-gettimeofday.c: Include <sys/time.h> rather than gettimeofday.h.
* Various fixes to Martin Lambers' gettimeofday patch.Bruno Haible2007-01-171-16/+4
|
* Patch from Martin Lambers <marlam@marlam.de>, from 2005-10-08Bruno Haible2007-01-171-0/+60
<http://lists.gnu.org/archive/html/bug-gnulib/2005-10/msg00093.html>