summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi6
-rw-r--r--gnu/system/file-systems.scm14
2 files changed, 19 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 42e62d4648..7bc10dc566 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3084,6 +3084,12 @@ Manual}).  Pseudo-terminals are used by terminal emulators such as
 @command{xterm}.
 @end defvr
 
+@defvr {Scheme Variable} %shared-memory-file-system
+This file system is mounted as @file{/dev/shm} and is used to support
+memory sharing across processes (@pxref{Memory-mapped I/O,
+@code{shm_open},, libc, The GNU C Library Reference Manual}).
+@end defvr
+
 @defvr {Scheme Variable} %binary-format-file-system
 The @code{binfmt_misc} file system, which allows handling of arbitrary
 executable file types to be delegated to user space.  This requires the
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 76460d95af..8700530a76 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -108,10 +108,22 @@
     (create-mount-point? #t)
     (options (string-append "gid=" (number->string %tty-gid) ",mode=620"))))
 
+(define %shared-memory-file-system
+  ;; Shared memory.
+  (file-system
+    (device "tmpfs")
+    (mount-point "/dev/shm")
+    (type "tmpfs")
+    (check? #f)
+    (flags '(no-suid no-dev))
+    (options "size=50%")                         ;TODO: make size configurable
+    (create-mount-point? #t)))
+
 (define %base-file-systems
   ;; List of basic file systems to be mounted.  Note that /proc and /sys are
   ;; currently mounted by the initrd.
   (list %devtmpfs-file-system
-        %pseudo-terminal-file-system))
+        %pseudo-terminal-file-system
+        %shared-memory-file-system))
 
 ;;; file-systems.scm ends here