summaryrefslogtreecommitdiff
path: root/tests/test-utimens.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* utimens: Avoid test failures on macOS 10.13.Bruno Haible2021-01-021-1/+1
| | | | | | | | | | | Reported by Martin Storsjö <martin@martin.st> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00003.html>. * tests/test-utimens-common.h (check_ctime): Define to -1 on macOS. * tests/test-utimens.h (test_utimens): Don't expect a ctime change when only the atime is requested to change. * tests/test-futimens.h (test_futimens): Likewise. * tests/test-lutimens.h (test_lutimens): Likewise.
* 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
|
* timespec: fix resolution confusionPaul Eggert2018-09-101-1/+1
| | | | | | | | | | | In normal usage, clock resolution is given in seconds, but the code was mistakenly using inverse seconds and calling it “resolution”. Fix this, partly by renaming two identifiers. The old names will be kept for a bit, to ease transition. * lib/timespec.h (TIMESPEC_HZ, LOG10_TIMESPEC_HZ): New constants, replacing TIMESPEC_RESOLUTION and LOG10_TIMESPEC_RESOLUTION, which are now obsolescent. All uses changed.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* futimens: don’t assume struct timespec layoutPaul Eggert2017-08-151-6/+28
| | | | | | | | | | | | | * m4/futimens.m4 (gl_FUNC_FUTIMENS): * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): * tests/test-fdutimensat.c (main): * tests/test-futimens.h (test_futimens): * tests/test-lutimens.h (test_lutimens): * tests/test-utimens.h (test_utimens): * tests/test-utimensat.c (main): Don’t assume that struct timespec is a two-member structure in tv_sec, tv_nsec order. Although this is true on all platforms we know about, POSIX does not guarantee it.
* 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".
* tests: factor out st_ctime-comparison code (a dozen uses)Jim Meyering2011-11-171-12/+4
| | | | | | | * tests/test-utimens-common.h (ctime_compare): Define. * tests/test-futimens.h (test_futimens): Replace open-coded equivalent. * tests/test-lutimens.h (test_lutimens): Likewise. * tests/test-utimens.h (test_utimens): Likewise.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* tests: fix license on several testsEric Blake2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of GPLv2+ was a relic of copy-and-paste, and not intentional. * tests/test-des.c: Update to GPLv3+. * tests/test-flock.c: Likewise. * tests/test-fsync.c: Likewise. * tests/test-futimens.h: Likewise. * tests/test-gc-arcfour.c: Likewise. * tests/test-gc-arctwo.c: Likewise. * tests/test-gc-des.c: Likewise. * tests/test-gc-hmac-md5.c: Likewise. * tests/test-gc-hmac-sha1.c: Likewise. * tests/test-gc-md2.c: Likewise. * tests/test-gc-md4.c: Likewise. * tests/test-gc-md5.c: Likewise. * tests/test-gc-pbkdf2-sha1.c: Likewise. * tests/test-gc-rijndael.c: Likewise. * tests/test-gc-sha1.c: Likewise. * tests/test-gc.c: Likewise. * tests/test-getcwd.c: Likewise. * tests/test-link.c: Likewise. * tests/test-link.h: Likewise. * tests/test-lutimens.h: Likewise. * tests/test-md2.c: Likewise. * tests/test-md4.c: Likewise. * tests/test-mkdir.h: Likewise. * tests/test-rename.c: Likewise. * tests/test-rename.h: Likewise. * tests/test-safe-alloc.c: Likewise. * tests/test-utimens-common.h: Likewise. * tests/test-utimens.h: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix indentation.Bruno Haible2009-12-241-1/+1
|
* utimens: check for ctime updateEric Blake2009-12-191-5/+32
| | | | | | | | | | | | | | futimens/utimensat on Linux fails to bump ctime if mtime is UTIME_OMIT and atime is specified. * tests/test-utimens-common.h (check_ctime): Define. * tests/test-utimens.h (test_utimens): Expose the Linux bug. * tests/test-futimens.h (test_futimens): Likewise. * tests/test-lutimens.h (test_lutimens): Likewise. * doc/posix-functions/futimens.texi (futimens): Document the bug. * doc/posix-functions/utimensat.texi (utimensat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* utimensat: work around Solaris 9 bugEric Blake2009-10-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | utimes("file/",times) mistakenly succeeds. This commit doesn't fix utimes, but does make utimensat be careful before calling utimes. The test is now enhanced to test trailing slashes and directories. Meanwhile, cygwin 1.5 stat() on a directory changes atime (it does a readdir under the hood to populate st_nlink), so only mtime of a directory is reliable enough for testing. Cygwin 1.7 no longer has this problem, because it no longer wastes time on st_nlink. * lib/utimens.c (fdutimens, lutimens): Force a stat if platform has trailing slash bugs. * tests/test-lutimens.h (test_lutimens): Enhance test. * tests/test-utimens.h (test_utimens): Likewise. * doc/posix-functions/utime.texi (utime): Document the bug. * doc/posix-functions/utimes.texi (utimes): Likewise. * doc/posix-functions/utimensat.texi (utimensat): Likewise. * doc/glibc-functions/futimesat.texi (futimesat): Likewise. * doc/glibc-functions/lutimes.texi (lutimes): Mention utimens. * doc/posix-functions/futimens.texi (futimens): Mention limitation. Signed-off-by: Eric Blake <ebb9@byu.net>
* utimens: let lutimens work on non-symlinksEric Blake2009-10-161-2/+26
| | | | | | | | | | | | | | | | | Coreutils new 'touch -h' is easier to write if we guarantee POSIX semantics of utimensat(fd,"file",NULL,AT_SYMLINK_NOFOLLOW), rather than blindly failing with ENOSYS even on non-symlinks. * lib/utimens.c (lutimens): Fall back to utimens rather than failing with ENOSYS, when file is not a symlink. (utimens): Reduce redirection. * tests/test-lutimens.h (test_lutimens): Update test to cover non-symlinks. * tests/test-utimens.h (test_utimens): Update test to cover symlinks. * tests/test-utimens.c (main): Update caller. Signed-off-by: Eric Blake <ebb9@byu.net>
* test-stat-time, test-utimens: improve portabilityEric Blake2009-10-161-34/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Eric Blake <ebb9@byu.net>
* utimens-tests: port to NFS file systemsEric Blake2009-10-121-3/+21
| | | | | | | | | | | | | | | | Testing on Solaris 8 with NFS: creat() and utimens(,NULL) seem to set timestamps according to the current time on the server, while utimens(,{,UTIME_NOW}) sets timestamps according to the current time on the client. If two machines are not perfectly synchronized in time, then this makes time appear to move backwards. Avoid spurious test failures caused by a mtime comparison across machines, by instead doing 2 mtime comparisons, each known to be from timestamps tied to a single machine. * tests/test-utimens.h (test_utimens): Add a utimens call prior to grabbing stat buffer. Signed-off-by: Eric Blake <ebb9@byu.net>
* utimens: add testEric Blake2009-10-101-0/+116
Exposes holes in our API, and several platform bugs. * modules/utimens-tests: New test. * tests/test-utimens.h: New file. * tests/test-futimens.h: Likewise. * tests/test-utimens.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>