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

syscalls: Add 'add-to-entropy-count'.

* guix/build/syscalls.scm (RNDADDTOENTCNT): New variable.
(add-to-entropy-count): New procedure.
* tests/syscalls.scm ("add-to-entropy-count"): New test.
This commit is contained in:
Ludovic Courtès
2019-10-05 21:54:31 +02:00
parent aace6f6dba
commit 5e5f716794
2 changed files with 41 additions and 0 deletions

View File

@@ -567,6 +567,19 @@
(let ((result (call-with-input-file "/var/run/utmpx" read-utmpx)))
(or (utmpx? result) (eof-object? result))))
(when (zero? (getuid))
(test-skip 1))
(test-equal "add-to-entropy-count"
EPERM
(call-with-output-file "/dev/urandom"
(lambda (port)
(catch 'system-error
(lambda ()
(add-to-entropy-count port 77)
#f)
(lambda args
(system-error-errno args))))))
(test-end)
(false-if-exception (delete-file temp-file))