1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

syscalls: Add 'getxattr'.

* guix/build/syscalls.scm (getxattr): New procedure.
* tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
This commit is contained in:
Jan (janneke) Nieuwenhuizen
2020-05-14 00:30:57 +02:00
committed by Jan Nieuwenhuizen
parent 1a044e3936
commit df05842332
2 changed files with 35 additions and 0 deletions

View File

@@ -270,6 +270,14 @@
(scandir* directory)
(scandir directory (const #t) string<?))))
(false-if-exception (delete-file temp-file))
(test-assert "getxattr, setxattr"
(let ((key "user.translator")
(value "/hurd/pfinet\0")
(file (open-file temp-file "w0")))
(setxattr temp-file key value)
(string=? (getxattr temp-file key) value)))
(false-if-exception (delete-file temp-file))
(test-equal "fcntl-flock wait"
42 ; the child's exit status