mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
syscalls: Add load-linux-module.
* guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented from guile-linux-syscalls.patch. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
c5cd4fad09
commit
23e525e109
1 changed files with 12 additions and 0 deletions
|
@ -578,6 +578,18 @@ (define-as-needed (reboot #:optional (cmd RB_AUTOBOOT))
|
|||
(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."
|
||||
|
|
Loading…
Reference in a new issue