mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 13:10:33 +02:00
syscalls: Add ‘mode’ parameter to ‘lock-file’.
* guix/build/syscalls.scm (lock-file): Add ‘mode’ parameter and honor it.
* tests/syscalls.scm ("lock-file + unlock-file"): New test.
Change-Id: I113fb4a8b35dd8782b9c0991574e39a4b4393333
This commit is contained in:
@@ -383,6 +383,19 @@
|
||||
(close-port file)
|
||||
result)))))))))
|
||||
|
||||
(test-equal "lock-file + unlock-file"
|
||||
'hello
|
||||
(call-with-temporary-directory
|
||||
(lambda (directory)
|
||||
(let* ((file (in-vicinity directory "lock"))
|
||||
(out (lock-file file #:wait? #f)))
|
||||
(display "hello" out)
|
||||
(unlock-file out)
|
||||
(let* ((in (lock-file file "r0"))
|
||||
(content (read in)))
|
||||
(unlock-file in)
|
||||
content)))))
|
||||
|
||||
(test-equal "set-thread-name"
|
||||
"Syscall Test"
|
||||
(let ((name (thread-name)))
|
||||
|
||||
Reference in New Issue
Block a user