[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70494] [PATCH 13/23] syscalls: Add unshare.
From: |
Christopher Baines |
Subject: |
[bug#70494] [PATCH 13/23] syscalls: Add unshare. |
Date: |
Sun, 21 Apr 2024 10:42:31 +0100 |
* guix/build/syscalls.scm (unshare): New procedure.
Change-Id: I7caad207117b17b349290e680277f650c51d2f3b
---
guix/build/syscalls.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 487ee68b43..492a229938 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -36,6 +36,7 @@ (define-module (guix build syscalls)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-19)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-71)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 regex)
#:use-module (ice-9 match)
@@ -121,6 +122,7 @@ (define-module (guix build syscalls)
mkdtemp!
fdatasync
pivot-root
+ unshare
scandir*
getxattr
setxattr
@@ -1183,6 +1185,16 @@ (define pivot-root
(list new-root put-old (strerror err))
(list err)))))))
+(define unshare
+ (false-if-exception
+ (let ((proc (syscall->procedure int "unshare" (list int))))
+ (lambda (flags)
+ (let ((ret err (proc flags)))
+ (unless (zero? ret)
+ (throw 'system-error "unshare" "~d ~d: ~A"
+ (list flags (strerror err))
+ (list err))))))))
+
;;;
;;; Opendir & co.
--
2.41.0
- [bug#70494] [PATCH 16/23] store: database: Log when aborting transactions., (continued)
- [bug#70494] [PATCH 16/23] store: database: Log when aborting transactions., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 17/23] store: database: Export transaction helpers., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 04/23] guix: store: environment: New module., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 18/23] guix: http-client: Add network-error?., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 19/23] http-client: Include EPIPE in network-error?., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 20/23] scripts: substitute: Simplify with-timeout usage., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 01/23] store: database: Register derivation outputs., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 21/23] scripts: substitute: Don't enforce cached connections in download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 08/23] store: Add text-output-path and text-output-path-from-hash., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 09/23] store: Add validate-store-name., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 13/23] syscalls: Add unshare.,
Christopher Baines <=
- [bug#70494] [PATCH 11/23] scripts: substitute: Untangle selecting fast vs small compressions., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 10/23] store: database: Add procedures for querying valid paths., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 12/23] scripts: substitute: Extract script specific output from download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 23/23] substitutes: Add #:keep-alive? keyword argument to download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 15/23] store: Export operation-id., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 06/23] store: Export protocol related constants., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 22/23] substitutes: Move download-nar from substitutes script to here., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 14/23] scripts: perform-download: Support configuring the %store-prefix., Christopher Baines, 2024/04/21