1// Copyright (C) 2017 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef MINIMUMLINUX_P_H
5#define MINIMUMLINUX_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18// EXTRA WARNING
19// -------------
20//
21// This file must also be valid assembler source.
22//
23
24#include "private/qglobal_p.h"
25
26QT_BEGIN_NAMESPACE
27
28/* Minimum Linux kernel version:
29 * We require the following features in Qt (unconditional, no fallback):
30 * Feature Added in version Macro
31 * - inotify_init1 before 2.6.12-rc12
32 * - futex(2) before 2.6.12-rc12
33 * - FUTEX_WAKE_OP 2.6.14 FUTEX_OP
34 * - linkat(2) 2.6.17 O_TMPFILE && QT_CONFIG(linkat)
35 * - FUTEX_PRIVATE_FLAG 2.6.22
36 * - O_CLOEXEC 2.6.23
37 * - eventfd 2.6.23
38 * - pipe2 & dup3 2.6.27
39 * - accept4 2.6.28
40 * - renameat2 3.16 QT_CONFIG(renameat2)
41 * - getrandom 3.17 QT_CONFIG(getentropy)
42 * - statx 4.11 QT_CONFIG(statx)
43 */
44
45#if QT_CONFIG(statx) && !QT_CONFIG(glibc)
46// if using glibc, the statx() function in sysdeps/unix/sysv/linux/statx.c
47// falls back to stat() for us.
48// (Using QT_CONFIG(glibc) instead of __GLIBC__ because the macros aren't
49// defined in assembler mode)
50# define QT_ELF_NOTE_OS_MAJOR 4
51# define QT_ELF_NOTE_OS_MINOR 11
52# define QT_ELF_NOTE_OS_PATCH 0
53#elif QT_CONFIG(getentropy)
54# define QT_ELF_NOTE_OS_MAJOR 3
55# define QT_ELF_NOTE_OS_MINOR 17
56# define QT_ELF_NOTE_OS_PATCH 0
57#elif QT_CONFIG(renameat2)
58# define QT_ELF_NOTE_OS_MAJOR 3
59# define QT_ELF_NOTE_OS_MINOR 16
60# define QT_ELF_NOTE_OS_PATCH 0
61#else
62# define QT_ELF_NOTE_OS_MAJOR 2
63# define QT_ELF_NOTE_OS_MINOR 6
64# define QT_ELF_NOTE_OS_PATCH 28
65#endif
66
67/* you must include <elf.h> */
68#define QT_ELF_NOTE_OS_TYPE ELF_NOTE_OS_LINUX
69
70QT_END_NAMESPACE
71
72#endif // MINIMUMLINUX_P_H
73

source code of qtbase/src/corelib/global/minimum-linux_p.h