[vlc-devel] [PATCH] linux: vlc_memfd: handle EOPNOTSUPP errno

Thomas Guillem thomas at gllm.fr
Fri Jun 14 11:11:33 CEST 2019

On Fri, Jun 14, 2019, at 10:25, Rémi Denis-Courmont wrote:
> Le vendredi 14 juin 2019, 10:17:16 EEST Thomas Guillem a écrit :
> > from manpage:
> > 
> > BUGS
> > One must check for two different error codes, EISDIR and ENOENT, when trying
> > to determine whether the kernel supports O_TMPFILE functionality.
> This is obviously incorrect. Feel free to patch the man pages.

No, I won't.

This is not a problem of manpages, but a problem with older libc/kernel implementation/bugs around O_TMPFILE.

cf. https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/open/open14.c#L52
EISDIR and ENOENT are expected to be checked in order to test if TMPFILE is supported.

As you can see O_TMPFILE feature was not added smoothly.

> The error code is:
> - ENOENT if /tmp does not exist,
> - EISDIR if /tmp exists and O_TMPFILE is ignored,
> - EOPNOTSUPP /tmp exists, O_TMPFILE is not ignored and the file system does not 
> support O_TMPFILE.
> In fact, we could just as well remove the special handling of ENOENT, because 
> the mkstemp() fallback is not going to work if /tmp does not exist.
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list