GNU bug report logs -
#26341
[PATCH] build: vm: Add missing module.
Previous Next
Full log
View this message in rfc822 format
* guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented
from guile-linux-syscalls.patch. Add to #:replace list.
---
guix/build/syscalls.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 42071e7b1..14d97fb61 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -148,6 +148,7 @@
RB_SW_SUSPEND
RB_KEXEC
reboot
+ load-linux-module
IFF_UP
IFF_BROADCAST
IFF_LOOPBACK
@@ -577,6 +578,22 @@ constants from <sys/mount.h>."
(throw 'system-error "reboot" "~S: ~A"
(list cmd (strerror err))
(list err))))))))
+
+(define load-linux-module
+ (static-or-ffi
+ 'load-linux-module
+ (let ((proc (syscall->procedure int "init_module"
+ (list '* unsigned-long '*))))
+ (lambda* (data #:optional (options ""))
+ (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.