summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/minimum-linux.S
Commit message (Collapse)AuthorAgeFilesLines
* Move the minimum Linux version declarations to a headerThiago Macieira2017-10-281-29/+4
| | | | | | | | I'll need it in the AF_NETLINK implementation of QNetworkInterface. Change-Id: Icaa86fc7b54d4b368c0efffd14ef5ce895d0ed5b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTemporaryFile: Add support for Linux's O_TMPFILEThiago Macieira2017-08-231-0/+1
| | | | | | | | | | | | | | | | | | That means a file is never created, unless you ask for the name. There's no chance of left-over temporary files being left behind. QSaveFile also benefits from this, since the save file is not present on disk until commit(). Unfortunately, QSaveFile must go through a temporary name because linkat(2) cannot overwrite -- we need rename(2) for that (for now). [ChangeLog][Important Behavior Changes][QTemporaryFile] On Linux, QTemporaryFile will attempt to create unnamed temporary files. If that succeeds, open() will return true but exists() will be false. If you call fileName() or any function that calls it, QTemporaryFile will give the file a name, so most applications will not see a difference. Change-Id: I1eba2b016de74620bfc8fffd14cc843e5b0919d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QFileSystemEngine::renameFile: use calls that don't overwriteThiago Macieira2017-08-041-0/+5
| | | | | | | | | | | | | | | | | The renameat2(2) Linux system call, new in 3.16, allows for the atomic renaming of a file if and only if it won't clobber an existing file. None of the Linux libcs have enabled this syscall as an API, so we use syscall(3) to place the call. If your libc has SYS_renameat2 but your kernel doesn't support it, we'll keep issuing the unknown syscall, every time. Users in that situation should upgrade (3.16 is from 2014). On Darwin, there's a similar renameatx_np (guessing "np" stands for "non-portable"). I haven't found anything similar on the other BSDs. Change-Id: I1eba2b016de74620bfc8fffd14ccb4e455a3ec9e Reviewed-by: David Faure <david.faure@kdab.com>
* QRandomGenerator: use getentropy on Linux & OpenBSDThiago Macieira2017-06-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | The getentropy function, first found in OpenBSD, is present in glibc since version 2.25 and Bionic since Android 6.0 and NDK r11. It uses the Linux 3.17 getrandom system call. Unlike glibc's getrandom() wrapper, the glibc implementation of getentropy() function is not a POSIX thread cancellation point, so we prefer to use that even though we have to break the reading into 256-byte blocks. The big advantage is that these functions work even in the absence of a /dev/urandom device node, in addition to a few cycles shaved off by not having to open a file descriptor and close it at exit. What's more, the glibc implementation blocks until entropy is available on early boot, so we don't have to worry about a failure mode. The Bionic implementation will fall back by itself to /dev/urandom and, failing that, gathering entropy from elsewhere in the system in a way it cannot fail either. uClibc has a wrapper to getrandom(2) but no getentropy(3). MUSL has neither. Change-Id: Ia53158e207a94bf49489fffd14c8cee1b968a619 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Linux: add a note to the ELF binary what minimum Linux is neededThiago Macieira2017-06-301-0/+92
Change-Id: Ia53158e207a94bf49489fffd14c8d2a1f173ff97 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>