From a1f708787d08e567da6118bacc481219884296ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 25 Apr 2016 17:18:58 +0200 Subject: syscalls: Add 'statfs'. * guix/build/syscalls.scm (): New record type. (fsword): New macro. (%statfs): New C struct. (statfs): New procedure. --- tests/syscalls.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/syscalls.scm') diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 24ea8f5e60..895f90f4d8 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -78,6 +78,21 @@ (rmdir dir) #t)))) +(test-equal "statfs, ENOENT" + ENOENT + (catch 'system-error + (lambda () + (statfs "/does-not-exist")) + (compose system-error-errno list))) + +(test-assert "statfs" + (let ((fs (statfs "/"))) + (and (file-system? fs) + (> (file-system-block-size fs) 0) + (>= (file-system-blocks-available fs) 0) + (>= (file-system-blocks-free fs) + (file-system-blocks-available fs))))) + (define (user-namespace pid) (string-append "/proc/" (number->string pid) "/ns/user")) -- cgit v1.2.3