authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-10 16:39:02-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-10 16:40:54-04:00
log7101e583d6a752fa1145c13c6e1a58f36bd35f2d
tree530056de9ddc6c4f8ebb06ead523bc47afa53bcb
parenta165cc05359114dc20af90232184a1af75dc9795
signaturelock-open Commit is signed but in an unrecognized format.

update glibc src files to 2.30


33 files changed, 288 insertions(+), 182 deletions(-)

lib/libc/glibc/elf/elf.h+30-2
...@@ -360,7 +360,7 @@ typedef struct...@@ -360,7 +360,7 @@ typedef struct
360#define EM_RISCV 243 /* RISC-V */360#define EM_RISCV 243 /* RISC-V */
361361
362#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */362#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */
363#define EM_CSKY 252 /* C_SKY */363#define EM_CSKY 252 /* C-SKY */
364364
365#define EM_NUM 253365#define EM_NUM 253
366366
...@@ -809,9 +809,16 @@ typedef struct...@@ -809,9 +809,16 @@ typedef struct
809#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */809#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
810#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension810#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension
811 registers */811 registers */
812#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication
813 code masks. */
814#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication
815 address keys. */
816#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication
817 generic key. */
812#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */818#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
813#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */819#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
814#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */820#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
821#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */
815822
816/* Legal values for the note segment descriptor types for object files. */823/* Legal values for the note segment descriptor types for object files. */
817824
...@@ -987,6 +994,9 @@ typedef struct...@@ -987,6 +994,9 @@ typedef struct
987#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */994#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */
988#define DF_1_STUB 0x04000000995#define DF_1_STUB 0x04000000
989#define DF_1_PIE 0x08000000996#define DF_1_PIE 0x08000000
997#define DF_1_KMOD 0x10000000
998#define DF_1_WEAKFILTER 0x20000000
999#define DF_1_NOCOMMON 0x40000000
9901000
991/* Flags for the feature selection in DT_FEATURE_1. */1001/* Flags for the feature selection in DT_FEATURE_1. */
992#define DTF_1_PARINIT 0x000000011002#define DTF_1_PARINIT 0x00000001
...@@ -2854,6 +2864,13 @@ enum...@@ -2854,6 +2864,13 @@ enum
2854#define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */2864#define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */
2855#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */2865#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */
28562866
2867/* AArch64 specific values for the Dyn d_tag field. */
2868#define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5)
2869#define DT_AARCH64_NUM 6
2870
2871/* AArch64 specific values for the st_other field. */
2872#define STO_AARCH64_VARIANT_PCS 0x80
2873
2857/* ARM relocs. */2874/* ARM relocs. */
28582875
2859#define R_ARM_NONE 0 /* No reloc */2876#define R_ARM_NONE 0 /* No reloc */
...@@ -3022,7 +3039,7 @@ enum...@@ -3022,7 +3039,7 @@ enum
3022/* Keep this the last entry. */3039/* Keep this the last entry. */
3023#define R_ARM_NUM 2563040#define R_ARM_NUM 256
30243041
3025/* csky */3042/* C-SKY */
3026#define R_CKCORE_NONE 0 /* no reloc */3043#define R_CKCORE_NONE 0 /* no reloc */
3027#define R_CKCORE_ADDR32 1 /* direct 32 bit (S + A) */3044#define R_CKCORE_ADDR32 1 /* direct 32 bit (S + A) */
3028#define R_CKCORE_PCRELIMM8BY4 2 /* disp ((S + A - P) >> 2) & 0xff */3045#define R_CKCORE_PCRELIMM8BY4 2 /* disp ((S + A - P) >> 2) & 0xff */
...@@ -3086,6 +3103,17 @@ enum...@@ -3086,6 +3103,17 @@ enum
3086#define R_CKCORE_TLS_DTPOFF32 573103#define R_CKCORE_TLS_DTPOFF32 57
3087#define R_CKCORE_TLS_TPOFF32 583104#define R_CKCORE_TLS_TPOFF32 58
30883105
3106/* C-SKY elf header definition. */
3107#define EF_CSKY_ABIMASK 0XF0000000
3108#define EF_CSKY_OTHER 0X0FFF0000
3109#define EF_CSKY_PROCESSOR 0X0000FFFF
3110
3111#define EF_CSKY_ABIV1 0X10000000
3112#define EF_CSKY_ABIV2 0X20000000
3113
3114/* C-SKY attributes section. */
3115#define SHT_CSKY_ATTRIBUTES (SHT_LOPROC + 1)
3116
3089/* IA-64 specific declarations. */3117/* IA-64 specific declarations. */
30903118
3091/* Processor specific flags for the Ehdr e_flags field. */3119/* Processor specific flags for the Ehdr e_flags field. */
lib/libc/glibc/include/elf.h+1-1
...@@ -23,7 +23,7 @@...@@ -23,7 +23,7 @@
23# endif23# endif
24# define DT_1_SUPPORTED_MASK \24# define DT_1_SUPPORTED_MASK \
25 (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \25 (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
26 | DF_1_ORIGIN | DF_1_NODEFLIB)26 | DF_1_ORIGIN | DF_1_NODEFLIB | DF_1_PIE)
2727
28#endif /* !_ISOMAC */28#endif /* !_ISOMAC */
29#endif /* elf.h */29#endif /* elf.h */
lib/libc/glibc/include/features.h+5-5
...@@ -414,10 +414,10 @@...@@ -414,10 +414,10 @@
414 instance, with GCC, -std=gnu11 will have C99-compliant scanf with414 instance, with GCC, -std=gnu11 will have C99-compliant scanf with
415 or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the415 or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
416 old extension. */416 old extension. */
417#if defined __USE_GNU && \417#if (defined __USE_GNU \
418 (defined __cplusplus \418 && (defined __cplusplus \
419 ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \419 ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \
420 : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))420 : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L)))
421# define __GLIBC_USE_DEPRECATED_SCANF 1421# define __GLIBC_USE_DEPRECATED_SCANF 1
422#else422#else
423# define __GLIBC_USE_DEPRECATED_SCANF 0423# define __GLIBC_USE_DEPRECATED_SCANF 0
...@@ -439,7 +439,7 @@...@@ -439,7 +439,7 @@
439/* Major and minor version number of the GNU C library package. Use439/* Major and minor version number of the GNU C library package. Use
440 these macros to test for features in specific releases. */440 these macros to test for features in specific releases. */
441#define __GLIBC__ 2441#define __GLIBC__ 2
442#define __GLIBC_MINOR__ 29442#define __GLIBC_MINOR__ 30
443443
444#define __GLIBC_PREREQ(maj, min) \444#define __GLIBC_PREREQ(maj, min) \
445 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))445 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
lib/libc/glibc/include/stap-probe.h+6-5
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
2121
22#ifdef USE_STAP_PROBE22#ifdef USE_STAP_PROBE
2323
24# include <stap-probe-machine.h>
24# include <sys/sdt.h>25# include <sys/sdt.h>
2526
26/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).27/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
...@@ -59,11 +60,11 @@...@@ -59,11 +60,11 @@
59/* Evaluate all the arguments and verify that N matches their number. */60/* Evaluate all the arguments and verify that N matches their number. */
60# define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__)61# define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__)
6162
62# define STAP_PROBE0()63# define STAP_PROBE0() do {} while (0)
63# define STAP_PROBE1(a1)64# define STAP_PROBE1(a1) do {} while (0)
64# define STAP_PROBE2(a1, a2)65# define STAP_PROBE2(a1, a2) do {} while (0)
65# define STAP_PROBE3(a1, a2, a3)66# define STAP_PROBE3(a1, a2, a3) do {} while (0)
66# define STAP_PROBE4(a1, a2, a3, a4)67# define STAP_PROBE4(a1, a2, a3, a4) do {} while (0)
6768
68# else69# else
69# define LIBC_PROBE(name, n, ...) /* Nothing. */70# define LIBC_PROBE(name, n, ...) /* Nothing. */
lib/libc/glibc/io/bits/statx.h+4-69
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* statx-related definitions and declarations.1/* statx-related definitions and declarations. Generic version.
2 Copyright (C) 2018-2019 Free Software Foundation, Inc.2 Copyright (C) 2018-2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
...@@ -19,73 +19,8 @@...@@ -19,73 +19,8 @@
19/* This interface is based on <linux/stat.h> in Linux. */19/* This interface is based on <linux/stat.h> in Linux. */
2020
21#ifndef _SYS_STAT_H21#ifndef _SYS_STAT_H
22# error Never include <bits/stat.x.h> directly, include <sys/stat.h> instead.22# error Never include <bits/statx.h> directly, include <sys/stat.h> instead.
23#endif23#endif
2424
25struct statx_timestamp25/* Use the generic definitions. */
26{26#include <bits/statx-generic.h>
27 __int64_t tv_sec;
28 __uint32_t tv_nsec;
29 __int32_t __statx_timestamp_pad1[1];
30};
31
32/* Warning: The kernel may add additional fields to this struct in the
33 future. Only use this struct for calling the statx function, not
34 for storing data. (Expansion will be controlled by the mask
35 argument of the statx function.) */
36struct statx
37{
38 __uint32_t stx_mask;
39 __uint32_t stx_blksize;
40 __uint64_t stx_attributes;
41 __uint32_t stx_nlink;
42 __uint32_t stx_uid;
43 __uint32_t stx_gid;
44 __uint16_t stx_mode;
45 __uint16_t __statx_pad1[1];
46 __uint64_t stx_ino;
47 __uint64_t stx_size;
48 __uint64_t stx_blocks;
49 __uint64_t stx_attributes_mask;
50 struct statx_timestamp stx_atime;
51 struct statx_timestamp stx_btime;
52 struct statx_timestamp stx_ctime;
53 struct statx_timestamp stx_mtime;
54 __uint32_t stx_rdev_major;
55 __uint32_t stx_rdev_minor;
56 __uint32_t stx_dev_major;
57 __uint32_t stx_dev_minor;
58 __uint64_t __statx_pad2[14];
59};
60
61#define STATX_TYPE 0x0001U
62#define STATX_MODE 0x0002U
63#define STATX_NLINK 0x0004U
64#define STATX_UID 0x0008U
65#define STATX_GID 0x0010U
66#define STATX_ATIME 0x0020U
67#define STATX_MTIME 0x0040U
68#define STATX_CTIME 0x0080U
69#define STATX_INO 0x0100U
70#define STATX_SIZE 0x0200U
71#define STATX_BLOCKS 0x0400U
72#define STATX_BASIC_STATS 0x07ffU
73#define STATX_ALL 0x0fffU
74#define STATX_BTIME 0x0800U
75#define STATX__RESERVED 0x80000000U
76
77#define STATX_ATTR_COMPRESSED 0x0004
78#define STATX_ATTR_IMMUTABLE 0x0010
79#define STATX_ATTR_APPEND 0x0020
80#define STATX_ATTR_NODUMP 0x0040
81#define STATX_ATTR_ENCRYPTED 0x0800
82#define STATX_ATTR_AUTOMOUNT 0x1000
83
84__BEGIN_DECLS
85
86/* Fill *BUF with information about PATH in DIRFD. */
87int statx (int __dirfd, const char *__restrict __path, int __flags,
88 unsigned int __mask, struct statx *__restrict __buf)
89 __THROW __nonnull ((2, 5));
90
91__END_DECLS
lib/libc/glibc/misc/sys/cdefs.h+10-2
...@@ -256,8 +256,8 @@...@@ -256,8 +256,8 @@
256/* Since version 4.5, gcc also allows one to specify the message printed256/* Since version 4.5, gcc also allows one to specify the message printed
257 when a deprecated function is used. clang claims to be gcc 4.2, but257 when a deprecated function is used. clang claims to be gcc 4.2, but
258 may also support this feature. */258 may also support this feature. */
259#if __GNUC_PREREQ (4,5) || \259#if __GNUC_PREREQ (4,5) \
260 __glibc_clang_has_extension (__attribute_deprecated_with_message__)260 || __glibc_clang_has_extension (__attribute_deprecated_with_message__)
261# define __attribute_deprecated_msg__(msg) \261# define __attribute_deprecated_msg__(msg) \
262 __attribute__ ((__deprecated__ (msg)))262 __attribute__ ((__deprecated__ (msg)))
263#else263#else
...@@ -412,6 +412,14 @@...@@ -412,6 +412,14 @@
412# define __glibc_has_attribute(attr) 0412# define __glibc_has_attribute(attr) 0
413#endif413#endif
414414
415#ifdef __has_include
416/* Do not use a function-like macro, so that __has_include can inhibit
417 macro expansion. */
418# define __glibc_has_include __has_include
419#else
420# define __glibc_has_include(header) 0
421#endif
422
415#if (!defined _Noreturn \423#if (!defined _Noreturn \
416 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \424 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
417 && !__GNUC_PREREQ (4,7))425 && !__GNUC_PREREQ (4,7))
lib/libc/glibc/posix/bits/types.h+11-8
...@@ -87,7 +87,7 @@ __extension__ typedef unsigned long long int __uintmax_t;...@@ -87,7 +87,7 @@ __extension__ typedef unsigned long long int __uintmax_t;
87 32 -- "natural" 32-bit type (always int)87 32 -- "natural" 32-bit type (always int)
88 64 -- "natural" 64-bit type (long or long long)88 64 -- "natural" 64-bit type (long or long long)
89 LONG32 -- 32-bit type, traditionally long89 LONG32 -- 32-bit type, traditionally long
90 QUAD -- 64-bit type, always long long90 QUAD -- 64-bit type, traditionally long long
91 WORD -- natural type of __WORDSIZE bits (int or long)91 WORD -- natural type of __WORDSIZE bits (int or long)
92 LONGWORD -- type of __WORDSIZE bits, traditionally long92 LONGWORD -- type of __WORDSIZE bits, traditionally long
9393
...@@ -113,14 +113,14 @@ __extension__ typedef unsigned long long int __uintmax_t;...@@ -113,14 +113,14 @@ __extension__ typedef unsigned long long int __uintmax_t;
113#define __SLONGWORD_TYPE long int113#define __SLONGWORD_TYPE long int
114#define __ULONGWORD_TYPE unsigned long int114#define __ULONGWORD_TYPE unsigned long int
115#if __WORDSIZE == 32115#if __WORDSIZE == 32
116# define __SQUAD_TYPE __quad_t116# define __SQUAD_TYPE __int64_t
117# define __UQUAD_TYPE __u_quad_t117# define __UQUAD_TYPE __uint64_t
118# define __SWORD_TYPE int118# define __SWORD_TYPE int
119# define __UWORD_TYPE unsigned int119# define __UWORD_TYPE unsigned int
120# define __SLONG32_TYPE long int120# define __SLONG32_TYPE long int
121# define __ULONG32_TYPE unsigned long int121# define __ULONG32_TYPE unsigned long int
122# define __S64_TYPE __quad_t122# define __S64_TYPE __int64_t
123# define __U64_TYPE __u_quad_t123# define __U64_TYPE __uint64_t
124/* We want __extension__ before typedef's that use nonstandard base types124/* We want __extension__ before typedef's that use nonstandard base types
125 such as `long long' in C89 mode. */125 such as `long long' in C89 mode. */
126# define __STD_TYPE __extension__ typedef126# define __STD_TYPE __extension__ typedef
...@@ -213,10 +213,13 @@ __STD_TYPE __U32_TYPE __socklen_t;...@@ -213,10 +213,13 @@ __STD_TYPE __U32_TYPE __socklen_t;
213 It is not currently necessary for this to be machine-specific. */213 It is not currently necessary for this to be machine-specific. */
214typedef int __sig_atomic_t;214typedef int __sig_atomic_t;
215215
216#if __TIMESIZE == 64216/* Seconds since the Epoch, visible to user code when time_t is too
217 narrow only for consistency with the old way of widening too-narrow
218 types. User code should never use __time64_t. */
219#if __TIMESIZE == 64 && defined __LIBC
217# define __time64_t __time_t220# define __time64_t __time_t
218#else221#elif __TIMESIZE != 64
219__STD_TYPE __TIME64_T_TYPE __time64_t; /* Seconds since the Epoch. */222__STD_TYPE __TIME64_T_TYPE __time64_t;
220#endif223#endif
221224
222#undef __STD_TYPE225#undef __STD_TYPE
lib/libc/glibc/posix/sys/types.h+8-25
...@@ -154,37 +154,20 @@ typedef unsigned int uint;...@@ -154,37 +154,20 @@ typedef unsigned int uint;
154154
155#include <bits/stdint-intn.h>155#include <bits/stdint-intn.h>
156156
157#if !__GNUC_PREREQ (2, 7)
158
159/* These were defined by ISO C without the first `_'. */157/* These were defined by ISO C without the first `_'. */
160typedef unsigned char u_int8_t;158typedef __uint8_t u_int8_t;
161typedef unsigned short int u_int16_t;159typedef __uint16_t u_int16_t;
162typedef unsigned int u_int32_t;160typedef __uint32_t u_int32_t;
163# if __WORDSIZE == 64161typedef __uint64_t u_int64_t;
164typedef unsigned long int u_int64_t;
165# else
166__extension__ typedef unsigned long long int u_int64_t;
167# endif
168
169typedef int register_t;
170
171#else
172
173/* For GCC 2.7 and later, we can use specific type-size attributes. */
174# define __u_intN_t(N, MODE) \
175 typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
176
177__u_intN_t (8, __QI__);
178__u_intN_t (16, __HI__);
179__u_intN_t (32, __SI__);
180__u_intN_t (64, __DI__);
181162
163#if __GNUC_PREREQ (2, 7)
182typedef int register_t __attribute__ ((__mode__ (__word__)));164typedef int register_t __attribute__ ((__mode__ (__word__)));
183165#else
166typedef int register_t;
167#endif
184168
185/* Some code from BIND tests this macro to see if the types above are169/* Some code from BIND tests this macro to see if the types above are
186 defined. */170 defined. */
187#endif
188#define __BIT_TYPES_DEFINED__ 1171#define __BIT_TYPES_DEFINED__ 1
189172
190173
lib/libc/glibc/signal/signal.h+3
...@@ -370,6 +370,9 @@ extern int __libc_current_sigrtmax (void) __THROW;...@@ -370,6 +370,9 @@ extern int __libc_current_sigrtmax (void) __THROW;
370#define SIGRTMIN (__libc_current_sigrtmin ())370#define SIGRTMIN (__libc_current_sigrtmin ())
371#define SIGRTMAX (__libc_current_sigrtmax ())371#define SIGRTMAX (__libc_current_sigrtmax ())
372372
373/* System-specific extensions. */
374#include <bits/signal_ext.h>
375
373__END_DECLS376__END_DECLS
374377
375#endif /* not signal.h */378#endif /* not signal.h */
lib/libc/glibc/stdlib/stdlib.h+8-5
...@@ -536,10 +536,11 @@ extern int lcong48_r (unsigned short int __param[7],...@@ -536,10 +536,11 @@ extern int lcong48_r (unsigned short int __param[7],
536#endif /* Use misc or X/Open. */536#endif /* Use misc or X/Open. */
537537
538/* Allocate SIZE bytes of memory. */538/* Allocate SIZE bytes of memory. */
539extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;539extern void *malloc (size_t __size) __THROW __attribute_malloc__
540 __attribute_alloc_size__ ((1)) __wur;
540/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */541/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
541extern void *calloc (size_t __nmemb, size_t __size)542extern void *calloc (size_t __nmemb, size_t __size)
542 __THROW __attribute_malloc__ __wur;543 __THROW __attribute_malloc__ __attribute_alloc_size__ ((1, 2)) __wur;
543544
544/* Re-allocate the previously allocated block545/* Re-allocate the previously allocated block
545 in PTR, making the new block SIZE bytes long. */546 in PTR, making the new block SIZE bytes long. */
...@@ -547,7 +548,7 @@ extern void *calloc (size_t __nmemb, size_t __size)...@@ -547,7 +548,7 @@ extern void *calloc (size_t __nmemb, size_t __size)
547 the same pointer that was passed to it, aliasing needs to be allowed548 the same pointer that was passed to it, aliasing needs to be allowed
548 between objects pointed by the old and new pointers. */549 between objects pointed by the old and new pointers. */
549extern void *realloc (void *__ptr, size_t __size)550extern void *realloc (void *__ptr, size_t __size)
550 __THROW __attribute_warn_unused_result__;551 __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2));
551552
552#ifdef __USE_MISC553#ifdef __USE_MISC
553/* Re-allocate the previously allocated block in PTR, making the new554/* Re-allocate the previously allocated block in PTR, making the new
...@@ -556,7 +557,8 @@ extern void *realloc (void *__ptr, size_t __size)...@@ -556,7 +557,8 @@ extern void *realloc (void *__ptr, size_t __size)
556 the same pointer that was passed to it, aliasing needs to be allowed557 the same pointer that was passed to it, aliasing needs to be allowed
557 between objects pointed by the old and new pointers. */558 between objects pointed by the old and new pointers. */
558extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)559extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
559 __THROW __attribute_warn_unused_result__;560 __THROW __attribute_warn_unused_result__
561 __attribute_alloc_size__ ((2, 3));
560#endif562#endif
561563
562/* Free a block allocated by `malloc', `realloc' or `calloc'. */564/* Free a block allocated by `malloc', `realloc' or `calloc'. */
...@@ -569,7 +571,8 @@ extern void free (void *__ptr) __THROW;...@@ -569,7 +571,8 @@ extern void free (void *__ptr) __THROW;
569#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \571#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
570 || defined __USE_MISC572 || defined __USE_MISC
571/* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */573/* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */
572extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;574extern void *valloc (size_t __size) __THROW __attribute_malloc__
575 __attribute_alloc_size__ ((1)) __wur;
573#endif576#endif
574577
575#ifdef __USE_XOPEN2K578#ifdef __USE_XOPEN2K
lib/libc/glibc/sysdeps/arm/sysdep.h+2-2
...@@ -295,8 +295,8 @@...@@ -295,8 +295,8 @@
295#endif295#endif
296296
297/* Pointer mangling support. */297/* Pointer mangling support. */
298#if (IS_IN (rtld) || \298#if (IS_IN (rtld) \
299 (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))299 || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
300# ifdef __ASSEMBLER__300# ifdef __ASSEMBLER__
301# define PTR_MANGLE_LOAD(guard, tmp) \301# define PTR_MANGLE_LOAD(guard, tmp) \
302 LDR_HIDDEN (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local), 0)302 LDR_HIDDEN (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local), 0)
lib/libc/glibc/sysdeps/generic/single-thread.h created+24
...@@ -0,0 +1,24 @@
1/* Single thread optimization, generic version.
2 Copyright (C) 2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
18
19#ifndef _SINGLE_THREAD_H
20#define _SINGLE_THREAD_H
21
22#define SINGLE_THREAD_P (0)
23
24#endif /* _SINGLE_THREAD_H */
lib/libc/glibc/sysdeps/generic/symbol-hacks.h+2-2
...@@ -11,8 +11,8 @@ asm ("memcpy = __GI_memcpy");...@@ -11,8 +11,8 @@ asm ("memcpy = __GI_memcpy");
11 __stack_chk_fail itself is a global symbol, exported from libc.so,11 __stack_chk_fail itself is a global symbol, exported from libc.so,
12 and cannot be made hidden. */12 and cannot be made hidden. */
1313
14# if IS_IN (libc) && defined SHARED && \14# if IS_IN (libc) && defined SHARED \
15 defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 015 && defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 0
16asm (".hidden __stack_chk_fail_local\n"16asm (".hidden __stack_chk_fail_local\n"
17 "__stack_chk_fail = __stack_chk_fail_local");17 "__stack_chk_fail = __stack_chk_fail_local");
18# endif18# endif
lib/libc/glibc/sysdeps/mach/hurd/bits/stat.h+2-2
...@@ -218,8 +218,8 @@ struct stat64...@@ -218,8 +218,8 @@ struct stat64
218#define S_IMMAP0 000100000000218#define S_IMMAP0 000100000000
219219
220/* ALL the unused bits. */220/* ALL the unused bits. */
221#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0| \221#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0 \
222 S_IUSEUNK|S_IUNKNOWN|07777))222 |S_IUSEUNK|S_IUNKNOWN|07777))
223#endif223#endif
224224
225#ifdef __USE_MISC225#ifdef __USE_MISC
lib/libc/glibc/sysdeps/nptl/libc-lockP.h+3-14
...@@ -71,23 +71,12 @@ typedef pthread_key_t __libc_key_t;...@@ -71,23 +71,12 @@ typedef pthread_key_t __libc_key_t;
71 For the C library we take a deeper look at the initializer. For71 For the C library we take a deeper look at the initializer. For
72 this implementation all fields are initialized to zero. Therefore72 this implementation all fields are initialized to zero. Therefore
73 we don't initialize the variable which allows putting it into the73 we don't initialize the variable which allows putting it into the
74 BSS section. (Except on PA-RISC and other odd architectures, where74 BSS section. */
75 initialized locks must be set to one due to the lack of normal
76 atomic operations.) */
7775
76_Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0");
78#define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER77#define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER
79#if IS_IN (libc) || IS_IN (libpthread)78#define __libc_lock_define_initialized(CLASS,NAME) \
80# if LLL_LOCK_INITIALIZER == 0
81# define __libc_lock_define_initialized(CLASS,NAME) \
82 CLASS __libc_lock_t NAME;
83# else
84# define __libc_lock_define_initialized(CLASS,NAME) \
85 CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER;
86# endif
87#else
88# define __libc_lock_define_initialized(CLASS,NAME) \
89 CLASS __libc_lock_t NAME;79 CLASS __libc_lock_t NAME;
90#endif
9180
92#define __libc_rwlock_define_initialized(CLASS,NAME) \81#define __libc_rwlock_define_initialized(CLASS,NAME) \
93 CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;82 CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
lib/libc/glibc/sysdeps/nptl/pthread.h+36
...@@ -770,6 +770,13 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,...@@ -770,6 +770,13 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
770 __abstime) __THROWNL __nonnull ((1, 2));770 __abstime) __THROWNL __nonnull ((1, 2));
771#endif771#endif
772772
773#ifdef __USE_GNU
774extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
775 clockid_t __clockid,
776 const struct timespec *__restrict
777 __abstime) __THROWNL __nonnull ((1, 3));
778#endif
779
773/* Unlock a mutex. */780/* Unlock a mutex. */
774extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)781extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
775 __THROWNL __nonnull ((1));782 __THROWNL __nonnull ((1));
...@@ -909,6 +916,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,...@@ -909,6 +916,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
909 __abstime) __THROWNL __nonnull ((1, 2));916 __abstime) __THROWNL __nonnull ((1, 2));
910# endif917# endif
911918
919# ifdef __USE_GNU
920extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
921 clockid_t __clockid,
922 const struct timespec *__restrict
923 __abstime) __THROWNL __nonnull ((1, 3));
924# endif
925
912/* Acquire write lock for RWLOCK. */926/* Acquire write lock for RWLOCK. */
913extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)927extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
914 __THROWNL __nonnull ((1));928 __THROWNL __nonnull ((1));
...@@ -924,6 +938,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,...@@ -924,6 +938,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
924 __abstime) __THROWNL __nonnull ((1, 2));938 __abstime) __THROWNL __nonnull ((1, 2));
925# endif939# endif
926940
941# ifdef __USE_GNU
942extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
943 clockid_t __clockid,
944 const struct timespec *__restrict
945 __abstime) __THROWNL __nonnull ((1, 3));
946# endif
947
927/* Unlock RWLOCK. */948/* Unlock RWLOCK. */
928extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)949extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
929 __THROWNL __nonnull ((1));950 __THROWNL __nonnull ((1));
...@@ -1003,6 +1024,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,...@@ -1003,6 +1024,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
1003 const struct timespec *__restrict __abstime)1024 const struct timespec *__restrict __abstime)
1004 __nonnull ((1, 2, 3));1025 __nonnull ((1, 2, 3));
10051026
1027# ifdef __USE_GNU
1028/* Wait for condition variable COND to be signaled or broadcast until
1029 ABSTIME measured by the specified clock. MUTEX is assumed to be
1030 locked before. CLOCK is the clock to use. ABSTIME is an absolute
1031 time specification against CLOCK's epoch.
1032
1033 This function is a cancellation point and therefore not marked with
1034 __THROW. */
1035extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
1036 pthread_mutex_t *__restrict __mutex,
1037 __clockid_t __clock_id,
1038 const struct timespec *__restrict __abstime)
1039 __nonnull ((1, 2, 4));
1040# endif
1041
1006/* Functions for handling condition variable attributes. */1042/* Functions for handling condition variable attributes. */
10071043
1008/* Initialize condition variable attribute ATTR. */1044/* Initialize condition variable attribute ATTR. */
lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h+1-1
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
32#define ENTRY(name) \32#define ENTRY(name) \
33 .globl C_SYMBOL_NAME(name); \33 .globl C_SYMBOL_NAME(name); \
34 .type C_SYMBOL_NAME(name),@function; \34 .type C_SYMBOL_NAME(name),@function; \
35 .align ALIGNARG(2); \35 .align ALIGNARG(4); \
36 C_LABEL(name) \36 C_LABEL(name) \
37 cfi_startproc; \37 cfi_startproc; \
38 CALL_MCOUNT38 CALL_MCOUNT
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-1
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
32#define ENTRY(name) \32#define ENTRY(name) \
33 .globl C_SYMBOL_NAME(name); \33 .globl C_SYMBOL_NAME(name); \
34 .type C_SYMBOL_NAME(name),@function; \34 .type C_SYMBOL_NAME(name),@function; \
35 .align ALIGNARG(2); \35 .align ALIGNARG(4); \
36 C_LABEL(name) \36 C_LABEL(name) \
37 cfi_startproc; \37 cfi_startproc; \
38 CALL_MCOUNT38 CALL_MCOUNT
lib/libc/glibc/sysdeps/unix/alpha/sysdep.h+1-1
...@@ -200,7 +200,7 @@ __LABEL(name) \...@@ -200,7 +200,7 @@ __LABEL(name) \
200 no matter what the "real" sign of the 32-bit type. We want to200 no matter what the "real" sign of the 32-bit type. We want to
201 preserve that when filling in values for the kernel. */201 preserve that when filling in values for the kernel. */
202#define syscall_promote(arg) \202#define syscall_promote(arg) \
203 (sizeof(arg) == 4 ? (long)(int)(long)(arg) : (long)(arg))203 (sizeof (arg) == 4 ? (long)(int)(long)(arg) : (long)(arg))
204204
205/* Make sure and "use" the variable that we're not returning,205/* Make sure and "use" the variable that we're not returning,
206 in order to suppress unused variable warnings. */206 in order to suppress unused variable warnings. */
lib/libc/glibc/sysdeps/unix/sysdep.h+1-1
...@@ -16,7 +16,7 @@...@@ -16,7 +16,7 @@
16 <http://www.gnu.org/licenses/>. */16 <http://www.gnu.org/licenses/>. */
1717
18#include <sysdeps/generic/sysdep.h>18#include <sysdeps/generic/sysdep.h>
1919#include <single-thread.h>
20#include <sys/syscall.h>20#include <sys/syscall.h>
21#define HAVE_SYSCALLS21#define HAVE_SYSCALLS
2222
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+3-3
...@@ -255,9 +255,9 @@...@@ -255,9 +255,9 @@
255#endif /* __ASSEMBLER__ */255#endif /* __ASSEMBLER__ */
256256
257/* Pointer mangling is supported for AArch64. */257/* Pointer mangling is supported for AArch64. */
258#if (IS_IN (rtld) || \258#if (IS_IN (rtld) \
259 (!defined SHARED && (IS_IN (libc) \259 || (!defined SHARED && (IS_IN (libc) \
260 || IS_IN (libpthread))))260 || IS_IN (libpthread))))
261# ifdef __ASSEMBLER__261# ifdef __ASSEMBLER__
262/* Note, dst, src, guard, and tmp are all register numbers rather than262/* Note, dst, src, guard, and tmp are all register numbers rather than
263 register names so they will work with both ILP32 and LP64. */263 register names so they will work with both ILP32 and LP64. */
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h+9-6
...@@ -22,12 +22,16 @@...@@ -22,12 +22,16 @@
2222
23#include_next <kernel-features.h>23#include_next <kernel-features.h>
2424
25/* There never has been support for fstat64. */25/* Support for statfs64 was added in 5.1. */
26#undef __ASSUME_STATFS6426#if __LINUX_KERNEL_VERSION < 0x050100
27#define __ASSUME_STATFS64 027# undef __ASSUME_STATFS64
28# define __ASSUME_STATFS64 0
29#endif
2830
29/* Alpha defines SysV ipc shmat syscall with a different name. */31/* Alpha used to define SysV ipc shmat syscall with a different name. */
30#define __NR_shmat __NR_osf_shmat32#ifndef __NR_shmat
33# define __NR_shmat __NR_osf_shmat
34#endif
3135
32#define __ASSUME_RECV_SYSCALL 136#define __ASSUME_RECV_SYSCALL 1
33#define __ASSUME_SEND_SYSCALL 137#define __ASSUME_SEND_SYSCALL 1
...@@ -45,7 +49,6 @@...@@ -45,7 +49,6 @@
45/* Support for copy_file_range, statx was added in kernel 4.13. */49/* Support for copy_file_range, statx was added in kernel 4.13. */
46#if __LINUX_KERNEL_VERSION < 0x040D0050#if __LINUX_KERNEL_VERSION < 0x040D00
47# undef __ASSUME_MLOCK251# undef __ASSUME_MLOCK2
48# undef __ASSUME_COPY_FILE_RANGE
49# undef __ASSUME_STATX52# undef __ASSUME_STATX
50#endif53#endif
5154
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h+3-1
...@@ -51,7 +51,9 @@...@@ -51,7 +51,9 @@
51 * Some syscalls no Linux program should know about:51 * Some syscalls no Linux program should know about:
52 */52 */
53#define __NR_osf_sigprocmask 4853#define __NR_osf_sigprocmask 48
54#define __NR_osf_shmat 20954#ifndef __NR_osf_shmat
55# define __NR_osf_shmat 209
56#endif
55#define __NR_osf_getsysinfo 25657#define __NR_osf_getsysinfo 256
56#define __NR_osf_setsysinfo 25758#define __NR_osf_setsysinfo 257
5759
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h-1
...@@ -45,7 +45,6 @@...@@ -45,7 +45,6 @@
45 present in 32-bit kernels from 4.4 and 4.5 respectively. */45 present in 32-bit kernels from 4.4 and 4.5 respectively. */
46#if __LINUX_KERNEL_VERSION < 0x04070046#if __LINUX_KERNEL_VERSION < 0x040700
47# undef __ASSUME_MLOCK247# undef __ASSUME_MLOCK2
48# undef __ASSUME_COPY_FILE_RANGE
49#endif48#endif
5049
51#undef __ASSUME_CLONE_DEFAULT50#undef __ASSUME_CLONE_DEFAULT
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h+2-2
...@@ -104,7 +104,7 @@ struct timex...@@ -104,7 +104,7 @@ struct timex
104#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */104#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
105105
106/* Read-only bits */106/* Read-only bits */
107#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \107#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER \
108 STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)108 | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
109109
110#endif /* bits/timex.h */110#endif /* bits/timex.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/pthread.h+36
...@@ -746,6 +746,13 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,...@@ -746,6 +746,13 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
746 __abstime) __THROWNL __nonnull ((1, 2));746 __abstime) __THROWNL __nonnull ((1, 2));
747#endif747#endif
748748
749#ifdef __USE_GNU
750extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
751 clockid_t __clockid,
752 const struct timespec *__restrict
753 __abstime) __THROWNL __nonnull ((1, 3));
754#endif
755
749/* Unlock a mutex. */756/* Unlock a mutex. */
750extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)757extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
751 __THROWNL __nonnull ((1));758 __THROWNL __nonnull ((1));
...@@ -885,6 +892,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,...@@ -885,6 +892,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
885 __abstime) __THROWNL __nonnull ((1, 2));892 __abstime) __THROWNL __nonnull ((1, 2));
886# endif893# endif
887894
895# ifdef __USE_GNU
896extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
897 clockid_t __clockid,
898 const struct timespec *__restrict
899 __abstime) __THROWNL __nonnull ((1, 3));
900# endif
901
888/* Acquire write lock for RWLOCK. */902/* Acquire write lock for RWLOCK. */
889extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)903extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
890 __THROWNL __nonnull ((1));904 __THROWNL __nonnull ((1));
...@@ -900,6 +914,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,...@@ -900,6 +914,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
900 __abstime) __THROWNL __nonnull ((1, 2));914 __abstime) __THROWNL __nonnull ((1, 2));
901# endif915# endif
902916
917# ifdef __USE_GNU
918extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
919 clockid_t __clockid,
920 const struct timespec *__restrict
921 __abstime) __THROWNL __nonnull ((1, 3));
922# endif
923
903/* Unlock RWLOCK. */924/* Unlock RWLOCK. */
904extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)925extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
905 __THROWNL __nonnull ((1));926 __THROWNL __nonnull ((1));
...@@ -979,6 +1000,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,...@@ -979,6 +1000,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
979 const struct timespec *__restrict __abstime)1000 const struct timespec *__restrict __abstime)
980 __nonnull ((1, 2, 3));1001 __nonnull ((1, 2, 3));
9811002
1003# ifdef __USE_GNU
1004/* Wait for condition variable COND to be signaled or broadcast until
1005 ABSTIME measured by the specified clock. MUTEX is assumed to be
1006 locked before. CLOCK is the clock to use. ABSTIME is an absolute
1007 time specification against CLOCK's epoch.
1008
1009 This function is a cancellation point and therefore not marked with
1010 __THROW. */
1011extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
1012 pthread_mutex_t *__restrict __mutex,
1013 __clockid_t __clock_id,
1014 const struct timespec *__restrict __abstime)
1015 __nonnull ((1, 2, 4));
1016# endif
1017
982/* Functions for handling condition variable attributes. */1018/* Functions for handling condition variable attributes. */
9831019
984/* Initialize condition variable attribute ATTR. */1020/* Initialize condition variable attribute ATTR. */
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h+4-2
...@@ -26,8 +26,10 @@...@@ -26,8 +26,10 @@
26#define __ASSUME_SEND_SYSCALL 126#define __ASSUME_SEND_SYSCALL 1
27#define __ASSUME_ACCEPT4_SYSCALL 127#define __ASSUME_ACCEPT4_SYSCALL 1
2828
29/* No statx system call on ia64 yet. */29/* Support for statx was added in 5.1. */
30#undef __ASSUME_STATX30#if __LINUX_KERNEL_VERSION < 0x050100
31# undef __ASSUME_STATX
32#endif
3133
32#undef __ASSUME_CLONE_DEFAULT34#undef __ASSUME_CLONE_DEFAULT
33#define __ASSUME_CLONE235#define __ASSUME_CLONE2
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h-7
...@@ -57,9 +57,6 @@...@@ -57,9 +57,6 @@
57 2.6.27. */57 2.6.27. */
58#define __ASSUME_IN_NONBLOCK 158#define __ASSUME_IN_NONBLOCK 1
5959
60/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */
61#define __ASSUME_FUTEX_CLOCK_REALTIME 1
62
63/* Support for preadv and pwritev was added in 2.6.30. */60/* Support for preadv and pwritev was added in 2.6.30. */
64#define __ASSUME_PREADV 161#define __ASSUME_PREADV 1
65#define __ASSUME_PWRITEV 162#define __ASSUME_PWRITEV 1
...@@ -103,10 +100,6 @@...@@ -103,10 +100,6 @@
103# define __ASSUME_MLOCK2 1100# define __ASSUME_MLOCK2 1
104#endif101#endif
105102
106#if __LINUX_KERNEL_VERSION >= 0x040500
107# define __ASSUME_COPY_FILE_RANGE 1
108#endif
109
110/* Support for statx was added in kernel 4.11. */103/* Support for statx was added in kernel 4.11. */
111#if __LINUX_KERNEL_VERSION >= 0x040B00104#if __LINUX_KERNEL_VERSION >= 0x040B00
112# define __ASSUME_STATX 1105# define __ASSUME_STATX 1
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h-5
...@@ -60,11 +60,6 @@...@@ -60,11 +60,6 @@
60# undef __ASSUME_MLOCK260# undef __ASSUME_MLOCK2
61#endif61#endif
6262
63/* Support for the copy_file_range syscall was added in 4.10. */
64#if __LINUX_KERNEL_VERSION < 0x040A00
65# undef __ASSUME_COPY_FILE_RANGE
66#endif
67
68/* Support for statx was added in kernel 4.12. */63/* Support for statx was added in kernel 4.12. */
69#if __LINUX_KERNEL_VERSION < 0X040C0064#if __LINUX_KERNEL_VERSION < 0X040C00
70# undef __ASSUME_STATX65# undef __ASSUME_STATX
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h+3-3
...@@ -233,9 +233,9 @@...@@ -233,9 +233,9 @@
233233
234#undef INTERNAL_SYSCALL234#undef INTERNAL_SYSCALL
235#define INTERNAL_SYSCALL(name, err, nr, args...) \235#define INTERNAL_SYSCALL(name, err, nr, args...) \
236 (((__NR_##name) < 256) ? \236 (((__NR_##name) < 256) \
237 INTERNAL_SYSCALL_DIRECT(name, err, nr, args) : \237 ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args) \
238 INTERNAL_SYSCALL_SVC0(name, err,nr, args))238 : INTERNAL_SYSCALL_SVC0(name, err,nr, args))
239239
240#undef INTERNAL_SYSCALL_ERROR_P240#undef INTERNAL_SYSCALL_ERROR_P
241#define INTERNAL_SYSCALL_ERROR_P(val, err) \241#define INTERNAL_SYSCALL_ERROR_P(val, err) \
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h+3-3
...@@ -239,9 +239,9 @@...@@ -239,9 +239,9 @@
239239
240#undef INTERNAL_SYSCALL240#undef INTERNAL_SYSCALL
241#define INTERNAL_SYSCALL(name, err, nr, args...) \241#define INTERNAL_SYSCALL(name, err, nr, args...) \
242 (((__NR_##name) < 256) ? \242 (((__NR_##name) < 256) \
243 INTERNAL_SYSCALL_DIRECT(name, err, nr, args) : \243 ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args) \
244 INTERNAL_SYSCALL_SVC0(name, err,nr, args))244 : INTERNAL_SYSCALL_SVC0(name, err,nr, args))
245245
246#undef INTERNAL_SYSCALL_ERROR_P246#undef INTERNAL_SYSCALL_ERROR_P
247#define INTERNAL_SYSCALL_ERROR_P(val, err) \247#define INTERNAL_SYSCALL_ERROR_P(val, err) \
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h+4-3
...@@ -49,10 +49,11 @@...@@ -49,10 +49,11 @@
49# undef __ASSUME_RENAMEAT249# undef __ASSUME_RENAMEAT2
50# undef __ASSUME_EXECVEAT50# undef __ASSUME_EXECVEAT
51# undef __ASSUME_MLOCK251# undef __ASSUME_MLOCK2
52# undef __ASSUME_COPY_FILE_RANGE
53#endif52#endif
5453
55/* sh does not support the statx system call. */54/* sh does not support the statx system call before 5.1. */
56#undef __ASSUME_STATX55#if __LINUX_KERNEL_VERSION < 0x050100
56# undef __ASSUME_STATX
57#endif
5758
58#endif59#endif
lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h created+62
...@@ -0,0 +1,62 @@
1/* Single thread optimization, Linux version.
2 Copyright (C) 2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
18
19#ifndef _SINGLE_THREAD_H
20#define _SINGLE_THREAD_H
21
22/* The default way to check if the process is single thread is by using the
23 pthread_t 'multiple_threads' field. However, for some architectures it is
24 faster to either use an extra field on TCB or global variables (the TCB
25 field is also used on x86 for some single-thread atomic optimizations).
26
27 The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread
28 check to use global variables instead of the pthread_t field. */
29
30#ifdef SINGLE_THREAD_BY_GLOBAL
31# if IS_IN (libc)
32extern int __libc_multiple_threads;
33# define SINGLE_THREAD_P \
34 __glibc_likely (__libc_multiple_threads == 0)
35# elif IS_IN (libpthread)
36extern int __pthread_multiple_threads;
37# define SINGLE_THREAD_P \
38 __glibc_likely (__pthread_multiple_threads == 0)
39# elif IS_IN (librt)
40# define SINGLE_THREAD_P \
41 __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
42 header.multiple_threads) == 0)
43# else
44/* For rtld, et cetera. */
45# define SINGLE_THREAD_P (1)
46# endif
47#else /* SINGLE_THREAD_BY_GLOBAL */
48# if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
49# define SINGLE_THREAD_P \
50 __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
51 header.multiple_threads) == 0)
52# else
53/* For rtld, et cetera. */
54# define SINGLE_THREAD_P (1)
55# endif
56#endif /* SINGLE_THREAD_BY_GLOBAL */
57
58#define RTLD_SINGLE_THREAD_P \
59 __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
60 header.multiple_threads) == 0)
61
62#endif /* _SINGLE_THREAD_H */