From 180339f16bff1b3570a05416e279b8376e61514a Mon Sep 17 00:00:00 2001 From: Gao feng Date: Thu, 29 Oct 2015 09:21:46 +0800 Subject: [PATCH] Mount /dev/shm by default Signed-off-by: Gao feng --- src/container.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/container.c b/src/container.c index 63a2d11..1aad90b 100644 --- a/src/container.c +++ b/src/container.c @@ -109,6 +109,16 @@ static int container_setup_mount(struct hyper_container *container) return -1; } + if (hyper_mkdir("/dev/shm") < 0) { + fprintf(stderr, "create /dev/shm failed\n"); + return -1; + } + + if (mount("tmpfs", "/dev/shm/", "tmpfs", 0, NULL) < 0) { + perror("mount shm failed"); + return -1; + } + if (hyper_mkdir("/dev/pts") < 0) { fprintf(stderr, "create /dev/pts failed\n"); return -1;