Glibc 2.21 and earlier have a bug that leaves the mode parameter unset
when O_TMPFILE is used. So we bypass the glibc implementation and go
directly for the syscall. We do this only for 32-bit x86, since of the
current, modern platforms, it's the only one that passes parameters on
the stack. Technically speaking, the glibc bug applies to all platforms,
but it turns out that on all others, it appears to work.
By doing this, we have two minor differences:
1) open() is a cancellation point, but syscall() isn't
2) if anyone tries to intercept open() calls via LD_PRELOAD, they're
not going to catch Qt's.
[ChangeLog][QtCore][QTemporaryFile] Worked around a bug in the GNU C
Library versions 2.21 and earlier (used on Linux) that caused temporary
files to be created with permissions 000.
Task-number: QTBUG-69436
Change-Id: I20fd00e600264ff98c6afffd1540dceea89fa91f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>