GNU bug report logs - #26341
[PATCH] build: vm: Add missing module.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>

Date: Sun, 2 Apr 2017 15:03:01 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: 26341 <at> debbugs.gnu.org
Cc: Mathieu Othacehe <m.othacehe <at> gmail.com>
Subject: bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module.
Date: Mon, 10 Apr 2017 19:18:13 +0200
* guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented
  from guile-linux-syscalls.patch.
---
 guix/build/syscalls.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index d1f3cd65c..0529c228a 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -578,6 +578,18 @@ constants from <sys/mount.h>."
                (list cmd (strerror err))
                (list err))))))
 
+(define-as-needed (load-linux-module data #:optional (options ""))
+  (let ((proc (syscall->procedure int "init_module"
+                                  (list '* unsigned-long '*))))
+    (let-values (((ret err)
+                  (proc (bytevector->pointer data)
+                        (bytevector-length data)
+                        (string->pointer options))))
+      (unless (zero? ret)
+        (throw 'system-error "load-linux-module" "~A"
+               (list (strerror err))
+               (list err))))))
+
 (define (kernel? pid)
   "Return #t if PID designates a \"kernel thread\" rather than a normal
 user-land process."
-- 
2.12.2





This bug report was last modified 8 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.