diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-07-03 10:52:55 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-07-03 17:50:04 +0200 |
commit | 25c7ff6a3ecbaa1e93b38d35c8cbff40b7f4edb8 (patch) | |
tree | 77aee44c3d14d98dfac93f504e6041f6dfbf5c83 /tests/syscalls.scm | |
parent | a5b34d9d24cababcaa9d5e93813ccb3196e11a95 (diff) | |
download | guix-25c7ff6a3ecbaa1e93b38d35c8cbff40b7f4edb8.tar guix-25c7ff6a3ecbaa1e93b38d35c8cbff40b7f4edb8.tar.gz |
syscalls: Define AT_SYMLINK_NOFOLLOW et al.
* guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): New variables.
* tests/syscalls.scm ("utime with AT_SYMLINK_NOFOLLOW"): New test.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r-- | tests/syscalls.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 0d07280b99..3e267c9f01 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -60,6 +60,19 @@ (any (cute member <> (mount-points)) '("/" "/proc" "/sys" "/dev"))) +(false-if-exception (delete-file temp-file)) +(test-equal "utime with AT_SYMLINK_NOFOLLOW" + '(0 0) + (begin + ;; Test libguile's utime with AT_SYMLINK_NOFOLLOW, which libguile does not + ;; define as of Guile 2.2.4. + (symlink "/nowhere" temp-file) + (utime temp-file 0 0 0 0 AT_SYMLINK_NOFOLLOW) + (let ((st (lstat temp-file))) + (delete-file temp-file) + ;; Note: 'utimensat' does not change 'ctime'. + (list (stat:mtime st) (stat:atime st))))) + (test-assert "swapon, ENOENT/EPERM" (catch 'system-error (lambda () |