* [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm
@ 2013-07-11 22:49 Gabriel de Perthuis
2013-07-12 8:44 ` Gabriel de Perthuis
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel de Perthuis @ 2013-07-11 22:49 UTC (permalink / raw)
To: Jeff Dike, Richard Weinberger; +Cc: user-mode-linux-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm
2013-07-11 22:49 [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm Gabriel de Perthuis
@ 2013-07-12 8:44 ` Gabriel de Perthuis
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel de Perthuis @ 2013-07-12 8:44 UTC (permalink / raw)
To: user-mode-linux-devel
Sorry, I didn't look at the list before sending.
The other patch does a realpath on /dev/shm which makes things
work when there's a compatibility symlink.
You might still consider a global s|/dev/shm|/run/shm|g
to be more future-proof.
> 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(-)
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-12 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11 22:49 [uml-devel] [PATCH] um: /run/shm has replaced /dev/shm Gabriel de Perthuis
2013-07-12 8:44 ` Gabriel de Perthuis
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.