Re: [PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-19 Thread Pekka Paalanen
On Thu, 19 Oct 2017 13:12:57 +0100 Emmanuel Gil Peyrot wrote: > On Wed, Oct 18, 2017 at 09:05:46AM -0500, Matt Hoosier wrote: > > On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic > > wrote: > > > + fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0); > > > + shm_unlink("/wa

Re: [PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-19 Thread Emmanuel Gil Peyrot
On Wed, Oct 18, 2017 at 09:05:46AM -0500, Matt Hoosier wrote: > On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic > wrote: > > + fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0); > > + shm_unlink("/wayland-cursor-shared"); > > This seems to be a departure from the anonymous

Re: [PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-18 Thread Pekka Paalanen
On Wed, 18 Oct 2017 22:53:04 -0700 Thiago Macieira wrote: > On Wednesday, 18 October 2017 07:05:46 PDT Matt Hoosier wrote: > > On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic > > > > wrote: > > > + fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0); > > > + shm_unlink("/

Re: [PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-18 Thread Thiago Macieira
On Wednesday, 18 October 2017 07:05:46 PDT Matt Hoosier wrote: > On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic > > wrote: > > + fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0); > > + shm_unlink("/wayland-cursor-shared"); > > This seems to be a departure from the anonym

Re: [PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-18 Thread Matt Hoosier
On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic wrote: > + fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0); > + shm_unlink("/wayland-cursor-shared"); This seems to be a departure from the anonymous behavior that mkstemp() previously offered. shm_open() says that it will o

[PATCH wayland] cursor: Use shm_open() instead of XDG_RUNTIME_DIR files

2017-10-18 Thread Quentin Glidic
From: Quentin Glidic Using XDG_RUNTIME_DIR to create anonymous files is problematic when XDG_RUNTIME_DIR is not a tmpfs. OTOH, shm_open is in POSIX.1-2001, so it should be available on all platforms we care about. As a bonus, the created fd is already CLOEXEC. Signed-off-by: Quentin Glidic ---