[PATCH] cursor: use memfd_create or shm_open for anonymous in-memory files

Simon Ser contact at emersion.fr
Thu Aug 16 10:59:56 UTC 2018


On August 16, 2018 11:57 AM, Jan Engelhardt <jengelh at inai.de> wrote:
> On Thursday 2018-08-16 12:41, Emil Velikov wrote:
>
> > On 15 August 2018 at 15:14, Simon Ser contact at emersion.fr wrote:
> >
> > > On Linux, try using memfd_create and file sealing. Fallback to
> > > shm_open on old kernels.
> > > On FreeBSD, use shm_open with SHM_ANON.
> > > Otherwise, use shm_open with a random name, making sure the name
> > > isn't already taken.
> >
> > Thinking out loud:
> > I wonder if the next POSIX standard will finally standardise
> > random/anonymous shm files. Be that shm_open+SHM_ANON [...]
>
> According to the shm_open.3 from Linux man-pages-4.16 project,
> shm_open is already marked standardized:
>
> CONFORMING TO
> POSIX.1-2001, POSIX.1-2008.

Yes, but this doesn't include SHM_ANON unfortunately. So we still need
to generate a random name and make sure it hasn't been taken already.


More information about the wayland-devel mailing list