summaryrefslogtreecommitdiff
path: root/src/init/main.zig
blob: a9b95a8bed74f3ccfc1a71c891cc3aea0323eed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const std = @import("std");
const os = std.os.linux;

pub fn main() !void {
	std.debug.print("\u{1b}[1;1H\u{1b}[J", .{});
	_ = std.os.linux.mount("none", "/dev/", "devtmpfs", 0, 0);


	const pid = @as(i32, @intCast(os.fork()));

	if (pid == 0) {
		_ = os.execve("process", &[_:null]?[*:0]const u8 { "process" }, &[0:null]?[*:0]const u8{});

		return error.ExecFailed;
	}

	var status: u32 = undefined;
	_ = os.waitpid(pid, &status, 0);

	while (true) { std.time.sleep(100); }
}