1. 19 Nov, 2011 2 commits
    • Bruno Haible's avatar
      Depend on module fcntl-h when AT_FDCWD is used. · e0009e0b
      Bruno Haible authored
      * modules/utimens (Depends-on): Add fcntl-h.
      * modules/areadlinkat (Depends-on): Likewise.
      * modules/areadlinkat-with-size (Depends-on): Likewise.
      * modules/faccessat (Depends-on): Likewise.
      * modules/fchmodat (Depends-on): Likewise.
      * modules/fchownat (Depends-on): Likewise.
      * modules/getcwd (Depends-on): Likewise.
      * modules/mkdirat (Depends-on): Likewise.
      * modules/mkfifoat (Depends-on): Likewise.
      * modules/readlinkat (Depends-on): Likewise.
      * modules/symlinkat (Depends-on): Likewise.
      * modules/dup2-tests (Depends-on): Likewise.
      * modules/fdutimensat-tests (Depends-on): Likewise.
      * modules/futimens-tests (Depends-on): Likewise.
      e0009e0b
    • Bruno Haible's avatar
      Ensure 'inline' can be used in tests/test-utimens-common.h. · be965b08
      Bruno Haible authored
      * modules/fdutimensat-tests (configure.ac): Require AC_C_INLINE.
      * modules/futimens-tests (configure.ac): Likewise.
      * modules/utimens-tests (configure.ac): Likewise.
      * modules/utimensat-tests (configure.ac): Likewise.
      be965b08
  2. 24 Sep, 2011 1 commit
    • Bruno Haible's avatar
      New module 'dup'. · 4810e2dc
      Bruno Haible authored
      * lib/unistd.in.h (dup): Declare only if the 'dup' module is in use.
      Allow replacement.
      * lib/dup.c: New file.
      * lib/fchdir.c (rpl_dup): Remove function.
      * m4/dup.m4: New file.
      * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_DUP here.
      * m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'dup' is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_DUP.
      * modules/unistd (Makefile.am): Substitute GNULIB_DUP.
      * modules/dup: New file.
      * tests/test-unistd-c++.cc: Check the signature of 'dup' only if the
      'dup' module is in use.
      * modules/fdopendir (Depends-on): Add dup.
      * modules/fdutimensat-tests (Depends-on): Likewise.
      * modules/fts (Depends-on): Likewise.
      * modules/futimens-tests (Depends-on): Likewise.
      * modules/posix_spawnp-tests (Depends-on): Likewise.
      * modules/unistd-safer-tests (Depends-on): Likewise.
      * modules/utimens-tests (Depends-on): Likewise.
      * doc/posix-functions/dup.texi: Mention the new module and the problem
      on MSVC.
      4810e2dc
  3. 17 Jun, 2011 1 commit
    • Bruno Haible's avatar
      Fix tests link errors. · edca61fe
      Bruno Haible authored
      * modules/ceil-ieee-tests (Makefile.am): Use CEIL_LIBM, not FLOOR_LIBM.
      * modules/chown-tests (Makefile.am): Don't link test-chown with
      LIBINTL.
      * modules/lchown-tests (Makefile.am): Don't link test-lchown with
      LIBINTL.
      * modules/utimens-tests (Makefile.am): Don't link test-utimens with
      LIBINTL.
      * modules/futimens-tests (Makefile.am): Don't link test-futimens with
      LIBINTL.
      edca61fe
  4. 01 Feb, 2010 1 commit
    • Eric Blake's avatar
      tests: silence warning about system return · 3220d5c6
      Eric Blake authored
      Silence a compiler warning for platforms that mark system()
      with attribute warn_unused_result.
      
      * tests/test-areadlink-with-size.c (main): Ignore system result.
      * 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-chown.c (main): Likewise.
      * tests/test-fchownat.c (main): Likewise.
      * tests/test-fdutimensat.c (main): Likewise.
      * tests/test-fstatat.c (main): Likewise.
      * tests/test-futimens.c (main): Likewise.
      * tests/test-lchown.c (main): Likewise.
      * tests/test-link.c (main): Likewise.
      * tests/test-linkat.c (main): Likewise.
      * tests/test-lstat.c (main): Likewise.
      * tests/test-mkdir.c (main): Likewise.
      * tests/test-mkdirat.c (main): Likewise.
      * tests/test-mkfifo.c (main): Likewise.
      * tests/test-mkfifoat.c (main): Likewise.
      * tests/test-mknod.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-symlink.c (main): Likewise.
      * tests/test-symlinkat.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.
      * modules/areadlink-tests (Depends-on): Add ignore-value.
      * modules/areadlink-with-size-tests (Depends-on): Likewise.
      * modules/areadlinkat-tests (Depends-on): Likewise.
      * modules/areadlinkat-with-size-tests (Depends-on): Likewise.
      * modules/canonicalize-lgpl-tests (Depends-on): Likewise.
      * modules/canonicalize-tests (Depends-on): Likewise.
      * modules/chown-tests (Depends-on): Likewise.
      * modules/fdutimensat-tests (Depends-on): Likewise.
      * modules/futimens-tests (Depends-on): Likewise.
      * modules/lchown-tests (Depends-on): Likewise.
      * modules/link-tests (Depends-on): Likewise.
      * modules/linkat-tests (Depends-on): Likewise.
      * modules/lstat-tests (Depends-on): Likewise.
      * modules/mkdir-tests (Depends-on): Likewise.
      * modules/mkfifo-tests (Depends-on): Likewise.
      * modules/mkfifoat-tests (Depends-on): Likewise.
      * modules/mknod-tests (Depends-on): Likewise.
      * modules/openat-tests (Depends-on): Likewise.
      * modules/readlink-tests (Depends-on): Likewise.
      * modules/remove-tests (Depends-on): Likewise.
      * modules/rename-tests (Depends-on): Likewise.
      * modules/renameat-tests (Depends-on): Likewise.
      * modules/rmdir-tests (Depends-on): Likewise.
      * modules/symlink-tests (Depends-on): Likewise.
      * modules/symlinkat-tests (Depends-on): Likewise.
      * modules/unlink-tests (Depends-on): Likewise.
      * modules/utimens-tests (Depends-on): Likewise.
      * modules/utimensat-tests (Depends-on): Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      3220d5c6
  5. 24 Dec, 2009 2 commits
    • Bruno Haible's avatar
      Refactor common macros used in tests. · 987e5651
      Bruno Haible authored
      987e5651
    • Eric Blake's avatar
      tests: add signature checks · 89ae4589
      Eric Blake authored
      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: default avatarEric Blake <ebb9@byu.net>
      89ae4589
  6. 21 Dec, 2009 1 commit
    • Eric Blake's avatar
      test-utimens: avoid spurious failure · c7362ef0
      Eric Blake authored
      Fixes a spurious failure on ext3, with one-second resolution,
      now that ctime effects are being tested for inequality.
      
      * tests/test-chown.h (nap): Factor...
      * tests/nap.h: ...into new file.
      * tests/test-lchown.h (nap): Avoid duplication.
      * tests/test-utimens-common.h (nap): Use shared implementation,
      necessary on file systems with 1-second resolution.
      * modules/chown-tests (Files): Include new file.
      * modules/fdutimensat-tests (Files): Likewise.
      * modules/futimens-tests (Files): Likewise.
      * modules/lchown-tests (Files): Likewise.
      * modules/openat-tests (Files): Likewise.
      * modules/utimens-tests (Files): Likewise.
      * modules/utimensat-tests (Files): Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      c7362ef0
  7. 18 Nov, 2009 1 commit
    • Eric Blake's avatar
      usleep: use it to simplify tests · 6038ee4b
      Eric Blake authored
      Blindly using usleep makes it easier to write tests.
      
      * modules/stat-time-tests (Depends-on): Add usleep.
      (configure.ac): Drop usleep check.
      * modules/chown-tests (Depends-on, configure.ac): Likewise.
      * modules/lchown-tests (Depends-on, configure.ac): Likewise.
      * modules/fdutimensat-tests (Depends-on, configure.ac): Likewise.
      * modules/futimens-tests (Depends-on, configure.ac): Likewise.
      * modules/openat-tests (Depends-on, configure.ac): Likewise.
      * modules/utimens-tests (Depends-on, configure.ac): Likewise.
      * modules/utimensat-tests (Depends-on, configure.ac): Likewise.
      * modules/pipe-filter-gi-tests (Depends-on, configure.ac):
      Likewise.
      * tests/test-chown.h (nap): Rely on nicer usleep semantics.
      * tests/test-lchown.h (nap): Likewise.
      * tests/test-pipe-filter-gi2-main.c (small_nap): Likewise.
      * tests/test-stat-time.c (nap): Likewise.
      * tests/test-utimens-common.h (nap): Update comments.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      6038ee4b
  8. 16 Oct, 2009 1 commit
    • Eric Blake's avatar
      test-stat-time, test-utimens: improve portability · 4d8f2295
      Eric Blake authored
      ext4 on an alpha system has a quantization of about 10 ms but
      a resolution of 1ns; utimecmp does not know about quantization,
      so tests were failing when comparing timestamps that fall
      within the same quantization window.  Add strategic usleeps
      throughout to minimize this issue, whether or not we later
      improve utimecmp to account for quantization.
      
      Windows (and hence cygwin) is documented as having a default
      clock quantization of 15.25 milliseconds (although it can be
      reduced to 1 millisecond); file timestamps are quantized to this
      boundary even though more accurate timing can be obtained.
      However, this means that 15 milliseconds is too short for any
      test that wants to guarantee crossing a file timestamp boundary.
      Cygwin, however, still has bugs where clock_gettime can lag
      behind file timestamps, which is not fixed by this patch.
      
      Solaris 9 with NFS exposed the same problem for futimes that was
      previously fixed for utimes on Solaris 8, where futimens(f,NULL)
      uses a different time source than futimes(,{,UTIME_NOW}).
      
      * tests/test-stat-time.c (nap): Lengthen delay to 20ms, for
      ext4 on alpha, and for cygwin.
      * tests/test-utimens-common.h: New file.
      (nap): Factor delays into single function.
      * tests/test-lutimens.h (test_lutimens): Use new header.
      * tests/test-futimens.h (test_futimens): Likewise.
      * tests/test-utimens.h (test_utimens): Likewise.  Also, force NFS
      timestamps to occur from same machine, as was done previously for
      test_utimens.
      * modules/utimens-tests (Files): Ship new file.
      * modules/futimens-tests (Files): Likewise.
      Reported in part by Jim Meyering.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      4d8f2295
  9. 10 Oct, 2009 1 commit
    • Eric Blake's avatar
      futimens: new module · 959d9cb4
      Eric Blake authored
      Provides futimens where it is missing, and rpl_futimens to work
      around bugs in older Linux kernels.
      
      * modules/futimens: New file.
      * lib/futimens.c (futimens): Likewise.
      * m4/futimens.m4 (gl_FUNC_FUTIMENS): Likewise.
      * lib/utimens.c (futimens): Avoid recursion into rpl_futimens, so
      we can work around Linux bugs.
      * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses.
      * modules/sys_stat (Makefile.am): Substitute them.
      * lib/sys_stat.in.h (futimens): Declare it.
      * MODULES.html.sh (systems lacking POSIX:2008): Mention module.
      * doc/posix-functions/futimens.texi (futimens): Likewise.
      * modules/futimens-tests: New test.
      * tests/test-futimens.c: Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      959d9cb4