[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module.
From: |
Mathieu Othacehe |
Subject: |
bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module. |
Date: |
Sat, 8 Apr 2017 18:03:28 +0200 |
* 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
- bug#26341: [PATCH] build: vm: Add missing module., (continued)
bug#26341: [PATCH 3/5] build: syscalls: Add mount and umount to #:replace list., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module.,
Mathieu Othacehe <=
bug#26341: [PATCH 5/5] build: Fix compilation warnings., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 2/5] build: syscalls: Allow use to network-interface syscalls independently of calling context., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 1/5] build: syscalls: Add reboot., Mathieu Othacehe, 2017/04/10
- bug#26341: [PATCH 2/5] build: syscalls: Use define-as-needed for mount and umount., Mathieu Othacehe, 2017/04/10
- bug#26341: [PATCH 5/5] build: Fix compilation warnings., Mathieu Othacehe, 2017/04/10
- bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module., Mathieu Othacehe, 2017/04/10
- bug#26341: [PATCH 3/5] build: syscalls: Use define-as-needed for network-interface syscalls., Mathieu Othacehe, 2017/04/10
- bug#26341: [PATCH 1/5] build: syscalls: Add reboot., Ludovic Courtès, 2017/04/11