From 2a1fccad8a72cf0f1f5dea81ae17f4772183ce50 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 18 Oct 2025 14:33:38 -0400 Subject: cmd: init: Attempt to mount tmpfs to /tmp During startup, it is up to the init system to mount the filesystems. This commit mounts the tmpfs filesystem to /tmp on startup Signed-off-by: Ian Moffett --- src/cmd/init/init.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/cmd/init/init.c b/src/cmd/init/init.c index 3f39743..9875306 100644 --- a/src/cmd/init/init.c +++ b/src/cmd/init/init.c @@ -28,13 +28,29 @@ */ #include +#include #include +#include void main(void) { char login_path[] = "/usr/sbin/login"; char *argv_dmmy[] = { "/usr/sbin/login", NULL }; + int error; + + /* Mount tmpfs */ + error = mount( + NULL, + "/tmp", + MOUNT_TMPFS, + 0, + NULL + ); + + if (error < 0) { + printf("init: failed to mount tmpfs\n"); + } spawn(login_path, argv_dmmy); for (;;); -- cgit v1.2.3