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

syscalls: Add ‘kexec-load-file’.

* guix/build/syscalls.scm (string->utf-8/nul-terminated)
(kexec-load-file): New procedures.
* tests/syscalls.scm ("kexec-load-file"): New test.

Change-Id: I3724226a14ecc07f346e77519fb5b0591096c7f6
This commit is contained in:
Ludovic Courtès
2024-12-19 15:51:59 +01:00
parent 5b8c19c208
commit 5c9029dc79
2 changed files with 71 additions and 0 deletions

View File

@@ -679,6 +679,19 @@
(lambda args
(system-error-errno args))))))
(when (or (zero? (getuid))
(not (string-contains %host-type "linux")))
(test-skip 1))
(test-equal "kexec-load-file"
EPERM
(catch 'system-error
(lambda ()
(let ((fd1 (open-fdes "/dev/null" O_RDONLY))
(fd2 (open-fdes "/dev/null" O_RDONLY)))
(kexec-load-file fd1 fd2 "gnu.repl=yes")))
(lambda args
(system-error-errno args))))
(test-end)
(false-if-exception (delete-file temp-file))