Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 7f8be96

Browse files
authored
Merge pull request #329 from laijs/initial-shm
Setup /dev/shm for the initial namespace
2 parents 6273c32 + 13c5f90 commit 7f8be96

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/init.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,16 @@ static int hyper_setup_init_process(void)
15211521
return -1;
15221522
}
15231523

1524+
if (hyper_mkdir("/dev/shm", 0755) < 0) {
1525+
fprintf(stderr, "create basic directory /dev/shm failed\n");
1526+
return -1;
1527+
}
1528+
1529+
if (mount("tmpfs", "/dev/shm/", "tmpfs", MS_NOSUID| MS_NODEV, NULL) < 0) {
1530+
perror("mount shm failed");
1531+
return -1;
1532+
}
1533+
15241534
if (hyper_mkdir("/dev/pts", 0755) < 0) {
15251535
perror("create basic directory failed");
15261536
return -1;

0 commit comments

Comments
 (0)