On Saturday, February 16, 2019 4:35 PM, Emmanuel Gil Peyrot 
<linkma...@linkmauve.fr> wrote:
> This (so-far) Linux-only API lets users create file descriptors purely
> in memory, without any backing file on the filesystem and the race
> condition which could ensue when unlink()ing it.
>
> It also allows seals to be placed on the file, ensuring to every other
> process that we won’t be allowed to shrink the contents, potentially
> causing a SIGBUS when they try reading it.
>
> This patch is best viewed with the -w option of git log -p.
>
> Signed-off-by: Emmanuel Gil Peyrot <linkma...@linkmauve.fr>

Nice! There's a small typo, but otherwise this LGTM.

Reviewed-by: Simon Ser <cont...@emersion.fr>

> +#ifdef HAVE_MEMFD_CREATE
> +     fd = memfd_create("wayland-cursor", MFD_CLOEXEC | MFD_ALLOW_SEALING);
> +     if (fd >= 0) {
> +             /* We can add this seal before calling posix_fallocate(), as
> +              * the file is currently zero-sized anyway.
> +              *
> +              * There is also no need to check for the return value, we
> +              * couldn't doanything with it anyway.

Typo: "do anything"

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to