From 5e5f7167943b408ae55736a44908a82056c87780 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 5 Oct 2019 21:54:31 +0200 Subject: 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. --- tests/syscalls.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/syscalls.scm b/tests/syscalls.scm index eeb223b950..1b3121e503 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -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)) -- cgit v1.2.3