summaryrefslogtreecommitdiff
path: root/tests/syscalls.scm
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2020-05-14 00:30:57 +0200
committerJan Nieuwenhuizen <janneke@gnu.org>2020-05-14 00:48:12 +0200
commitdf05842332be80ed7f53022402b95cf711163b41 (patch)
tree8626f5f1eb82a74369cd1269f75dc13603d84c39 /tests/syscalls.scm
parent1a044e3936ac4c1ba1575fe791bf59577b039cf9 (diff)
syscalls: Add 'getxattr'.
* guix/build/syscalls.scm (getxattr): New procedure. * tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r--tests/syscalls.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 7fe0cd15456..3823de7c1e0 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -271,6 +271,14 @@
271 (scandir directory (const #t) string<?)))) 271 (scandir directory (const #t) string<?))))
272 272
273(false-if-exception (delete-file temp-file)) 273(false-if-exception (delete-file temp-file))
274(test-assert "getxattr, setxattr"
275 (let ((key "user.translator")
276 (value "/hurd/pfinet\0")
277 (file (open-file temp-file "w0")))
278 (setxattr temp-file key value)
279 (string=? (getxattr temp-file key) value)))
280
281(false-if-exception (delete-file temp-file))
274(test-equal "fcntl-flock wait" 282(test-equal "fcntl-flock wait"
275 42 ; the child's exit status 283 42 ; the child's exit status
276 (let ((file (open-file temp-file "w0b"))) 284 (let ((file (open-file temp-file "w0b")))