summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-11-23 11:22:30 +0100
committerLudovic Courtès <ludo@gnu.org>2021-11-23 11:29:38 +0100
commitb15e543d303ea58fdc0f0541c708389f9d513e3d (patch)
tree5c4bd48d67d4d3cd4806269dcabf58382f448bed /guix/build
parent4efc08d895274ee39e6e6e5c49121fb05a0281b6 (diff)
parentdaf7b5ecef8de0e536ffd8d2957f022d010767a8 (diff)
downloadguix-patches-b15e543d303ea58fdc0f0541c708389f9d513e3d.tar
guix-patches-b15e543d303ea58fdc0f0541c708389f9d513e3d.tar.gz
Merge branch 'master' into core-updates-frozen
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/syscalls.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 15b2ea6ff3..45f95c509d 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -71,6 +71,11 @@
mounts
mount-points
+ SWAP_FLAG_PREFER
+ SWAP_FLAG_PRIO_MASK
+ SWAP_FLAG_PRIO_SHIFT
+ SWAP_FLAG_DISCARD
+
swapon
swapoff
@@ -687,6 +692,13 @@ current process."
"Return the mounts points for currently mounted file systems."
(map mount-point (mounts)))
+;; Pulled from glibc's sysdeps/unix/sysv/linux/sys/swap.h
+
+(define SWAP_FLAG_PREFER #x8000) ;; Set if swap priority is specified.
+(define SWAP_FLAG_PRIO_MASK #x7fff)
+(define SWAP_FLAG_PRIO_SHIFT 0)
+(define SWAP_FLAG_DISCARD #x10000) ;; Discard swap cluster after use.
+
(define swapon
(let ((proc (syscall->procedure int "swapon" (list '* int))))
(lambda* (device #:optional (flags 0))