[RFC] XDG_RUNTIME_DIR

Lennart Poettering mzkqt at 0pointer.de
Sun Nov 14 06:02:37 PST 2010


On Sun, 14.11.10 10:41, Mikkel Kamstrup Erlandsen (mikkel.kamstrup at gmail.com) wrote:

> 
> On 13 November 2010 23:28, Lennart Poettering <mzkqt at 0pointer.de> wrote:
> > On Sat, 13.11.10 23:12, Mikkel Kamstrup Erlandsen (mikkel.kamstrup at gmail.com) wrote:
> >
> >> It's not totally clear from the discussions on this list, what kind of
> >> items you intend to go in XDG_USER_DIR? As I read it we are mainly
> >> talking sockets, fifos, pid-files and such. However what about stuff
> >> with non-negligible size - downloads in progress, short lived caches,
> >> etc. I unpack tonnes of source packages that I always forget to delete
> >> - will XDG_RUNTIME_DIR be suitible for this?
> >
> > No. $XDG_CACHE_HOME is for that, or /tmp.
> 
> Ok, good. I was hoping to hear that. However I think you must make
> that crystal clear in the spec, as I'm pretty sure that I head people
> talking about using it for stuff like this.

The XDG basedir spec is already pretty clear about that. We'll just add
the definition of XDG_RUNTIME_DIR to that.

> >> I heard mention of using it for mmap()ed files - but if the runtime
> >> dir is on a tmpfs (and not swapped) that would seem to undermine the
> >> value of mmapping it - or am I misunderstanding something?
> >
> > Hmm? tmpfs and mmap mix very well, not sure what you are intending to
> > say. Note that /dev/shm is usually tmpfs as well.
> 
> Ok, I haven't thought this completely through. My idea was just that
> having a mmap() of something that was already held in memory on a
> tmpfs was sorta superfluous, only adding a convenience API to access
> it like an array. But on second consideration I realize that there are
> numerous other benefits.

mmap() is not an API to make something be "held in memory". It's just a
different way in accessing a file, regardless of the backing store.

> But it brings me back to the question about what is "legal" to keep in
> XDG_RUNTIME_DIR. Is a file big enough to consider mmap()ing ok?

I am not sure I understand your question.

As long as we care for 32bit machines it is of course a bad idea to
place files > 2G in the directory, because after we did that we would
already have run out of address space.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the xdg mailing list