From: Gabriel de Perthuis <g2p.code@gmail.com>
To: Jeff Dike <jdike@addtoit.com>, Richard Weinberger <richard@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm
Date: Fri, 12 Jul 2013 00:49:32 +0200 [thread overview]
Message-ID: <51DF367C.5050307@gmail.com> (raw)
Look at /run/shm instead of /dev/shm.
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
To: Jeff Dike <jdike@addtoit.com>
To: Richard Weinberger <richard@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
---
There's a TMPDIR fallback so I haven't complicated this change with a fallback to /dev/shm.
arch/um/os-Linux/mem.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index ba43980..11d1db7 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -92,18 +92,18 @@ static int next(int fd, char *buf, size_t size, char c)
/* which_tmpdir is called only during early boot */
static int checked_tmpdir = 0;
/*
- * Look for a tmpfs mounted at /dev/shm. I couldn't find a cleaner
+ * Look for a tmpfs mounted at /run/shm. I couldn't find a cleaner
* way to do this than to parse /proc/mounts. statfs will return the
- * same filesystem magic number and fs id for both /dev and /dev/shm
+ * same filesystem magic number and fs id for both /run and /run/shm
* when they are both tmpfs, so you can't tell if they are different
* filesystems. Also, there seems to be no other way of finding the
* mount point of a filesystem from within it.
*
- * If a /dev/shm tmpfs entry is found, then we switch to using it.
+ * If a /run/shm tmpfs entry is found, then we switch to using it.
* Otherwise, we stay with the default /tmp.
*/
static void which_tmpdir(void)
{
int fd, found;
@@ -112,11 +112,11 @@ static void which_tmpdir(void)
if (checked_tmpdir)
return;
checked_tmpdir = 1;
- printf("Checking for tmpfs mount on /dev/shm...");
+ printf("Checking for tmpfs mount on /run/shm...");
fd = open("/proc/mounts", O_RDONLY);
if (fd < 0) {
printf("failed to open /proc/mounts, errno = %d\n", errno);
return;
@@ -125,21 +125,21 @@ static void which_tmpdir(void)
while (1) {
found = next(fd, buf, ARRAY_SIZE(buf), ' ');
if (found != 1)
break;
- if (!strncmp(buf, "/dev/shm", strlen("/dev/shm")))
+ if (!strncmp(buf, "/run/shm", strlen("/run/shm")))
goto found;
found = next(fd, buf, ARRAY_SIZE(buf), '\n');
if (found != 1)
break;
}
err:
if (found == 0)
- printf("nothing mounted on /dev/shm\n");
+ printf("nothing mounted on /run/shm\n");
else if (found < 0)
printf("read returned errno %d\n", -found);
out:
close(fd);
@@ -155,11 +155,11 @@ found:
printf("not tmpfs\n");
goto out;
}
printf("OK\n");
- default_tmpdir = "/dev/shm";
+ default_tmpdir = "/run/shm";
goto out;
}
static int __init make_tempfile(const char *template, char **out_tempname,
int do_unlink)
--
1.8.3.2.736.gf6be4c2.dirty
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2013-07-11 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-11 22:49 Gabriel de Perthuis [this message]
2013-07-12 8:44 ` [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm Gabriel de Perthuis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51DF367C.5050307@gmail.com \
--to=g2p.code@gmail.com \
--cc=jdike@addtoit.com \
--cc=richard@nod.at \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.