summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/minimum-linux_p.h
blob: 509ad792f7ed3cb392915c99256315b3fbc18c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (C) 2017 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef MINIMUMLINUX_P_H
#define MINIMUMLINUX_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

// EXTRA WARNING
// -------------
//
// This file must also be valid assembler source.
//

#include "private/qglobal_p.h"

QT_BEGIN_NAMESPACE

/* Minimum Linux kernel version:
 * We require the following features in Qt (unconditional, no fallback):
 *   Feature                    Added in version        Macro
 * - inotify_init1              before 2.6.12-rc12
 * - futex(2)                   before 2.6.12-rc12
 * - FUTEX_WAKE_OP              2.6.14                  FUTEX_OP
 * - linkat(2)                  2.6.17                  O_TMPFILE && QT_CONFIG(linkat)
 * - FUTEX_PRIVATE_FLAG         2.6.22
 * - O_CLOEXEC                  2.6.23
 * - eventfd                    2.6.23
 * - pipe2 & dup3               2.6.27
 * - accept4                    2.6.28
 * - renameat2                  3.16                    QT_CONFIG(renameat2)
 * - getrandom                  3.17                    QT_CONFIG(getentropy)
 * - statx                      4.11                    QT_CONFIG(statx)
 */

#if QT_CONFIG(statx) && !QT_CONFIG(glibc)
// if using glibc, the statx() function in sysdeps/unix/sysv/linux/statx.c
// falls back to stat() for us.
// (Using QT_CONFIG(glibc) instead of __GLIBC__ because the macros aren't
// defined in assembler mode)
#  define QT_ELF_NOTE_OS_MAJOR      4
#  define QT_ELF_NOTE_OS_MINOR      11
#  define QT_ELF_NOTE_OS_PATCH      0
#elif QT_CONFIG(getentropy)
#  define QT_ELF_NOTE_OS_MAJOR      3
#  define QT_ELF_NOTE_OS_MINOR      17
#  define QT_ELF_NOTE_OS_PATCH      0
#elif QT_CONFIG(renameat2)
#  define QT_ELF_NOTE_OS_MAJOR      3
#  define QT_ELF_NOTE_OS_MINOR      16
#  define QT_ELF_NOTE_OS_PATCH      0
#else
#  define QT_ELF_NOTE_OS_MAJOR      2
#  define QT_ELF_NOTE_OS_MINOR      6
#  define QT_ELF_NOTE_OS_PATCH      28
#endif

/* you must include <elf.h> */
#define QT_ELF_NOTE_OS_TYPE         ELF_NOTE_OS_LINUX

QT_END_NAMESPACE

#endif // MINIMUMLINUX_P_H