aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-01-04 00:16:41 +0900
committerOphestra <cat@gensokyo.uk>2025-01-04 00:16:41 +0900
commita1148edd006f9bd0c802fd63fa1338f57623326a (patch)
treecef4431bd3af7ab16475cbe4796d96da7d90a5fe /fst
parent6acd0d4e88af6a80836c5409023bbb6ebc57231f (diff)
fst/config: allocate filesystem slice
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'fst')
-rw-r--r--fst/config.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/fst/config.go b/fst/config.go
index ea7d45ad..8827b291 100644
--- a/fst/config.go
+++ b/fst/config.go
@@ -136,11 +136,17 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) {
}
conf := (&bwrap.Config{
- Net: s.Net,
- UserNS: s.UserNS,
- Hostname: s.Hostname,
- Clearenv: true,
- SetEnv: s.Env,
+ Net: s.Net,
+ UserNS: s.UserNS,
+ Hostname: s.Hostname,
+ Clearenv: true,
+ SetEnv: s.Env,
+
+ /* this is only 4 KiB of memory on a 64-bit system,
+ permissive defaults on NixOS results in around 100 entries
+ so this capacity should eliminate copies for most setups */
+ Filesystem: make([]bwrap.FSBuilder, 0, 256),
+
NewSession: !s.NoNewSession,
DieWithParent: true,
AsInit: true,