| author | |
| committer | |
| log | 7101e583d6a752fa1145c13c6e1a58f36bd35f2d |
| tree | 530056de9ddc6c4f8ebb06ead523bc47afa53bcb |
| parent | a165cc05359114dc20af90232184a1af75dc9795 |
| signature |
33 files changed, 288 insertions(+), 182 deletions(-)
lib/libc/glibc/elf/elf.h+30-2| ... | ... | @@ -360,7 +360,7 @@ typedef struct |
| 360 | 360 | #define EM_RISCV	243	/* RISC-V */ |
| 361 | 361 | |
| 362 | 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 */ | |
| 364 | 364 | |
| 365 | 365 | #define EM_NUM		253 |
| 366 | 366 | |
| ... | ... | @@ -809,9 +809,16 @@ typedef struct |
| 809 | 809 | #define NT_ARM_SYSTEM_CALL	0x404	/* ARM system call number */ |
| 810 | 810 | #define NT_ARM_SVE	0x405		/* ARM Scalable Vector Extension |
| 811 | 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 | 818 | #define NT_VMCOREDD	0x700		/* Vmcore Device Dump Note. */ |
| 813 | 819 | #define NT_MIPS_DSP	0x800		/* MIPS DSP ASE registers. */ |
| 814 | 820 | #define NT_MIPS_FP_MODE	0x801		/* MIPS floating-point mode. */ |
| 821 | #define NT_MIPS_MSA	0x802		/* MIPS SIMD registers. */ | |
| 815 | 822 | |
| 816 | 823 | /* Legal values for the note segment descriptor types for object files. */ |
| 817 | 824 | |
| ... | ... | @@ -987,6 +994,9 @@ typedef struct |
| 987 | 994 | #define	DF_1_SINGLETON	0x02000000	/* Singleton symbols are used. */ |
| 988 | 995 | #define	DF_1_STUB	0x04000000 |
| 989 | 996 | #define	DF_1_PIE	0x08000000 |
| 997 | #define	DF_1_KMOD 0x10000000 | |
| 998 | #define	DF_1_WEAKFILTER 0x20000000 | |
| 999 | #define	DF_1_NOCOMMON 0x40000000 | |
| 990 | 1000 | |
| 991 | 1001 | /* Flags for the feature selection in DT_FEATURE_1. */ |
| 992 | 1002 | #define DTF_1_PARINIT	0x00000001 |
| ... | ... | @@ -2854,6 +2864,13 @@ enum |
| 2854 | 2864 | #define R_AARCH64_TLSDESC 1031	/* TLS Descriptor. */ |
| 2855 | 2865 | #define R_AARCH64_IRELATIVE	1032	/* STT_GNU_IFUNC relocation. */ |
| 2856 | 2866 | |
| 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 | 2874 | /* ARM relocs. */ |
| 2858 | 2875 | |
| 2859 | 2876 | #define R_ARM_NONE		0	/* No reloc */ |
| ... | ... | @@ -3022,7 +3039,7 @@ enum |
| 3022 | 3039 | /* Keep this the last entry. */ |
| 3023 | 3040 | #define R_ARM_NUM		256 |
| 3024 | 3041 | |
| 3025 | /* csky */ | |
| 3042 | /* C-SKY */ | |
| 3026 | 3043 | #define R_CKCORE_NONE 0	/* no reloc */ |
| 3027 | 3044 | #define R_CKCORE_ADDR32 1	/* direct 32 bit (S + A) */ |
| 3028 | 3045 | #define R_CKCORE_PCRELIMM8BY4 2	/* disp ((S + A - P) >> 2) & 0xff */ |
| ... | ... | @@ -3086,6 +3103,17 @@ enum |
| 3086 | 3103 | #define R_CKCORE_TLS_DTPOFF32 57 |
| 3087 | 3104 | #define R_CKCORE_TLS_TPOFF32 58 |
| 3088 | 3105 | |
| 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 | 3117 | /* IA-64 specific declarations. */ |
| 3090 | 3118 | |
| 3091 | 3119 | /* Processor specific flags for the Ehdr e_flags field. */ |
lib/libc/glibc/include/elf.h+1-1| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | # endif |
| 24 | 24 | # define DT_1_SUPPORTED_MASK \ |
| 25 | 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) | |
| 27 | 27 | |
| 28 | 28 | #endif /* !_ISOMAC */ |
| 29 | 29 | #endif /* elf.h */ |
lib/libc/glibc/include/features.h+5-5| ... | ... | @@ -414,10 +414,10 @@ |
| 414 | 414 | instance, with GCC, -std=gnu11 will have C99-compliant scanf with |
| 415 | 415 | or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the |
| 416 | 416 | old extension. */ |
| 417 | #if defined __USE_GNU &&						\ | |
| 418 | (defined __cplusplus							\ | |
| 419 | ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__)	\ | |
| 420 | : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L)) | |
| 417 | #if (defined __USE_GNU							\ | |
| 418 | && (defined __cplusplus						\ | |
| 419 | 	 ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \ | |
| 420 | 	 : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))) | |
| 421 | 421 | # define __GLIBC_USE_DEPRECATED_SCANF 1 |
| 422 | 422 | #else |
| 423 | 423 | # define __GLIBC_USE_DEPRECATED_SCANF 0 |
| ... | ... | @@ -439,7 +439,7 @@ |
| 439 | 439 | /* Major and minor version number of the GNU C library package. Use |
| 440 | 440 | these macros to test for features in specific releases. */ |
| 441 | 441 | #define	__GLIBC__	2 |
| 442 | #define	__GLIBC_MINOR__	29 | |
| 442 | #define	__GLIBC_MINOR__	30 | |
| 443 | 443 | |
| 444 | 444 | #define __GLIBC_PREREQ(maj, min) \ |
| 445 | 445 | 	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) |
lib/libc/glibc/include/stap-probe.h+6-5| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | |
| 22 | 22 | #ifdef USE_STAP_PROBE |
| 23 | 23 | |
| 24 | # include <stap-probe-machine.h> | |
| 24 | 25 | # include <sys/sdt.h> |
| 25 | 26 | |
| 26 | 27 | /* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn). |
| ... | ... | @@ -59,11 +60,11 @@ |
| 59 | 60 | /* Evaluate all the arguments and verify that N matches their number. */ |
| 60 | 61 | # define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__) |
| 61 | 62 | |
| 62 | # define STAP_PROBE0() | |
| 63 | # define STAP_PROBE1(a1) | |
| 64 | # define STAP_PROBE2(a1, a2) | |
| 65 | # define STAP_PROBE3(a1, a2, a3) | |
| 66 | # define STAP_PROBE4(a1, a2, a3, a4) | |
| 63 | # define STAP_PROBE0()				do {} while (0) | |
| 64 | # define STAP_PROBE1(a1)			do {} while (0) | |
| 65 | # define STAP_PROBE2(a1, a2)			do {} while (0) | |
| 66 | # define STAP_PROBE3(a1, a2, a3)		do {} while (0) | |
| 67 | # define STAP_PROBE4(a1, a2, a3, a4)		do {} while (0) | |
| 67 | 68 | |
| 68 | 69 | # else |
| 69 | 70 | # define LIBC_PROBE(name, n, ...)		/* Nothing. */ |
lib/libc/glibc/io/bits/statx.h+4-69| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* statx-related definitions and declarations. | |
| 1 | /* statx-related definitions and declarations. Generic version. | |
| 2 | 2 | Copyright (C) 2018-2019 Free Software Foundation, Inc. |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -19,73 +19,8 @@ |
| 19 | 19 | /* This interface is based on <linux/stat.h> in Linux. */ |
| 20 | 20 | |
| 21 | 21 | #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 | 23 | #endif |
| 24 | 24 | |
| 25 | struct statx_timestamp | |
| 26 | { | |
| 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.) */ | |
| 36 | struct 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. */ | |
| 87 | int 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 | |
| 25 | /* Use the generic definitions. */ | |
| 26 | #include <bits/statx-generic.h> |
lib/libc/glibc/misc/sys/cdefs.h+10-2| ... | ... | @@ -256,8 +256,8 @@ |
| 256 | 256 | /* Since version 4.5, gcc also allows one to specify the message printed |
| 257 | 257 | when a deprecated function is used. clang claims to be gcc 4.2, but |
| 258 | 258 | may also support this feature. */ |
| 259 | #if __GNUC_PREREQ (4,5) || \ | |
| 260 | __glibc_clang_has_extension (__attribute_deprecated_with_message__) | |
| 259 | #if __GNUC_PREREQ (4,5) \ | |
| 260 | || __glibc_clang_has_extension (__attribute_deprecated_with_message__) | |
| 261 | 261 | # define __attribute_deprecated_msg__(msg) \ |
| 262 | 262 | 	 __attribute__ ((__deprecated__ (msg))) |
| 263 | 263 | #else |
| ... | ... | @@ -412,6 +412,14 @@ |
| 412 | 412 | # define __glibc_has_attribute(attr)	0 |
| 413 | 413 | #endif |
| 414 | 414 | |
| 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 | 423 | #if (!defined _Noreturn \ |
| 416 | 424 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 417 | 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 | 87 | 	32		-- "natural" 32-bit type (always int) |
| 88 | 88 | 	64		-- "natural" 64-bit type (long or long long) |
| 89 | 89 | 	LONG32		-- 32-bit type, traditionally long |
| 90 | 	QUAD		-- 64-bit type, always long long | |
| 90 | 	QUAD		-- 64-bit type, traditionally long long | |
| 91 | 91 | 	WORD		-- natural type of __WORDSIZE bits (int or long) |
| 92 | 92 | 	LONGWORD	-- type of __WORDSIZE bits, traditionally long |
| 93 | 93 | |
| ... | ... | @@ -113,14 +113,14 @@ __extension__ typedef unsigned long long int __uintmax_t; |
| 113 | 113 | #define __SLONGWORD_TYPE	long int |
| 114 | 114 | #define __ULONGWORD_TYPE	unsigned long int |
| 115 | 115 | #if __WORDSIZE == 32 |
| 116 | # define __SQUAD_TYPE		__quad_t | |
| 117 | # define __UQUAD_TYPE		__u_quad_t | |
| 116 | # define __SQUAD_TYPE		__int64_t | |
| 117 | # define __UQUAD_TYPE		__uint64_t | |
| 118 | 118 | # define __SWORD_TYPE		int |
| 119 | 119 | # define __UWORD_TYPE		unsigned int |
| 120 | 120 | # define __SLONG32_TYPE		long int |
| 121 | 121 | # define __ULONG32_TYPE		unsigned long int |
| 122 | # define __S64_TYPE		__quad_t | |
| 123 | # define __U64_TYPE		__u_quad_t | |
| 122 | # define __S64_TYPE		__int64_t | |
| 123 | # define __U64_TYPE		__uint64_t | |
| 124 | 124 | /* We want __extension__ before typedef's that use nonstandard base types |
| 125 | 125 | such as `long long' in C89 mode. */ |
| 126 | 126 | # define __STD_TYPE		__extension__ typedef |
| ... | ... | @@ -213,10 +213,13 @@ __STD_TYPE __U32_TYPE __socklen_t; |
| 213 | 213 | It is not currently necessary for this to be machine-specific. */ |
| 214 | 214 | typedef int __sig_atomic_t; |
| 215 | 215 | |
| 216 | #if __TIMESIZE == 64 | |
| 216 | /* 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 | 220 | # define __time64_t __time_t |
| 218 | #else | |
| 219 | __STD_TYPE __TIME64_T_TYPE __time64_t;	/* Seconds since the Epoch. */ | |
| 221 | #elif __TIMESIZE != 64 | |
| 222 | __STD_TYPE __TIME64_T_TYPE __time64_t; | |
| 220 | 223 | #endif |
| 221 | 224 | |
| 222 | 225 | #undef __STD_TYPE |
lib/libc/glibc/posix/sys/types.h+8-25| ... | ... | @@ -154,37 +154,20 @@ typedef unsigned int uint; |
| 154 | 154 | |
| 155 | 155 | #include <bits/stdint-intn.h> |
| 156 | 156 | |
| 157 | #if !__GNUC_PREREQ (2, 7) | |
| 158 | ||
| 159 | 157 | /* These were defined by ISO C without the first `_'. */ |
| 160 | typedef	unsigned char u_int8_t; | |
| 161 | typedef	unsigned short int u_int16_t; | |
| 162 | typedef	unsigned int u_int32_t; | |
| 163 | # if __WORDSIZE == 64 | |
| 164 | typedef unsigned long int u_int64_t; | |
| 165 | # else | |
| 166 | __extension__ typedef unsigned long long int u_int64_t; | |
| 167 | # endif | |
| 168 | ||
| 169 | typedef 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__); | |
| 158 | typedef __uint8_t u_int8_t; | |
| 159 | typedef __uint16_t u_int16_t; | |
| 160 | typedef __uint32_t u_int32_t; | |
| 161 | typedef __uint64_t u_int64_t; | |
| 181 | 162 | |
| 163 | #if __GNUC_PREREQ (2, 7) | |
| 182 | 164 | typedef int register_t __attribute__ ((__mode__ (__word__))); |
| 183 | ||
| 165 | #else | |
| 166 | typedef int register_t; | |
| 167 | #endif | |
| 184 | 168 | |
| 185 | 169 | /* Some code from BIND tests this macro to see if the types above are |
| 186 | 170 | defined. */ |
| 187 | #endif | |
| 188 | 171 | #define __BIT_TYPES_DEFINED__	1 |
| 189 | 172 | |
| 190 | 173 |
lib/libc/glibc/signal/signal.h+3| ... | ... | @@ -370,6 +370,9 @@ extern int __libc_current_sigrtmax (void) __THROW; |
| 370 | 370 | #define SIGRTMIN (__libc_current_sigrtmin ()) |
| 371 | 371 | #define SIGRTMAX (__libc_current_sigrtmax ()) |
| 372 | 372 | |
| 373 | /* System-specific extensions. */ | |
| 374 | #include <bits/signal_ext.h> | |
| 375 | ||
| 373 | 376 | __END_DECLS |
| 374 | 377 | |
| 375 | 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 | 536 | #endif	/* Use misc or X/Open. */ |
| 537 | 537 | |
| 538 | 538 | /* Allocate SIZE bytes of memory. */ |
| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; | |
| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | |
| 540 | __attribute_alloc_size__ ((1)) __wur; | |
| 540 | 541 | /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ |
| 541 | 542 | extern void *calloc (size_t __nmemb, size_t __size) |
| 542 | __THROW __attribute_malloc__ __wur; | |
| 543 | __THROW __attribute_malloc__ __attribute_alloc_size__ ((1, 2)) __wur; | |
| 543 | 544 | |
| 544 | 545 | /* Re-allocate the previously allocated block |
| 545 | 546 | in PTR, making the new block SIZE bytes long. */ |
| ... | ... | @@ -547,7 +548,7 @@ extern void *calloc (size_t __nmemb, size_t __size) |
| 547 | 548 | the same pointer that was passed to it, aliasing needs to be allowed |
| 548 | 549 | between objects pointed by the old and new pointers. */ |
| 549 | 550 | extern void *realloc (void *__ptr, size_t __size) |
| 550 | __THROW __attribute_warn_unused_result__; | |
| 551 | __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2)); | |
| 551 | 552 | |
| 552 | 553 | #ifdef __USE_MISC |
| 553 | 554 | /* Re-allocate the previously allocated block in PTR, making the new |
| ... | ... | @@ -556,7 +557,8 @@ extern void *realloc (void *__ptr, size_t __size) |
| 556 | 557 | the same pointer that was passed to it, aliasing needs to be allowed |
| 557 | 558 | between objects pointed by the old and new pointers. */ |
| 558 | 559 | extern 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 | 562 | #endif |
| 561 | 563 | |
| 562 | 564 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ |
| ... | ... | @@ -569,7 +571,8 @@ extern void free (void *__ptr) __THROW; |
| 569 | 571 | #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ |
| 570 | 572 | || defined __USE_MISC |
| 571 | 573 | /* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */ |
| 572 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur; | |
| 574 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ | |
| 575 | __attribute_alloc_size__ ((1)) __wur; | |
| 573 | 576 | #endif |
| 574 | 577 | |
| 575 | 578 | #ifdef __USE_XOPEN2K |
lib/libc/glibc/sysdeps/arm/sysdep.h+2-2| ... | ... | @@ -295,8 +295,8 @@ |
| 295 | 295 | #endif |
| 296 | 296 | |
| 297 | 297 | /* Pointer mangling support. */ |
| 298 | #if (IS_IN (rtld) || \ | |
| 299 | (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread)))) | |
| 298 | #if (IS_IN (rtld) \ | |
| 299 | || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread)))) | |
| 300 | 300 | # ifdef __ASSEMBLER__ |
| 301 | 301 | # define PTR_MANGLE_LOAD(guard, tmp)					\ |
| 302 | 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 | 11 | __stack_chk_fail itself is a global symbol, exported from libc.so, |
| 12 | 12 | and cannot be made hidden. */ |
| 13 | 13 | |
| 14 | # if IS_IN (libc) && defined SHARED && \ | |
| 15 | defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 0 | |
| 14 | # if IS_IN (libc) && defined SHARED \ | |
| 15 | && defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 0 | |
| 16 | 16 | asm (".hidden __stack_chk_fail_local\n" |
| 17 | 17 | "__stack_chk_fail = __stack_chk_fail_local"); |
| 18 | 18 | # endif |
lib/libc/glibc/sysdeps/mach/hurd/bits/stat.h+2-2| ... | ... | @@ -218,8 +218,8 @@ struct stat64 |
| 218 | 218 | #define S_IMMAP0	000100000000 |
| 219 | 219 | |
| 220 | 220 | /* ALL the unused bits. */ |
| 221 | #define	S_ISPARE	(~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0| \ | |
| 222 | 			 S_IUSEUNK|S_IUNKNOWN|07777)) | |
| 221 | #define	S_ISPARE	(~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0 \ | |
| 222 | 			 |S_IUSEUNK|S_IUNKNOWN|07777)) | |
| 223 | 223 | #endif |
| 224 | 224 | |
| 225 | 225 | #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 | 71 | For the C library we take a deeper look at the initializer. For |
| 72 | 72 | this implementation all fields are initialized to zero. Therefore |
| 73 | 73 | we don't initialize the variable which allows putting it into the |
| 74 | BSS section. (Except on PA-RISC and other odd architectures, where | |
| 75 | initialized locks must be set to one due to the lack of normal | |
| 76 | atomic operations.) */ | |
| 74 | BSS section. */ | |
| 77 | 75 | |
| 76 | _Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0"); | |
| 78 | 77 | #define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER |
| 79 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 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) \ | |
| 78 | #define __libc_lock_define_initialized(CLASS,NAME) \ | |
| 89 | 79 | CLASS __libc_lock_t NAME; |
| 90 | #endif | |
| 91 | 80 | |
| 92 | 81 | #define __libc_rwlock_define_initialized(CLASS,NAME) \ |
| 93 | 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 | 770 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 771 | 771 | #endif |
| 772 | 772 | |
| 773 | #ifdef __USE_GNU | |
| 774 | extern 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 | 780 | /* Unlock a mutex. */ |
| 774 | 781 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) |
| 775 | 782 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -909,6 +916,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 909 | 916 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 910 | 917 | # endif |
| 911 | 918 | |
| 919 | # ifdef __USE_GNU | |
| 920 | extern 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 | 926 | /* Acquire write lock for RWLOCK. */ |
| 913 | 927 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) |
| 914 | 928 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -924,6 +938,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 924 | 938 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 925 | 939 | # endif |
| 926 | 940 | |
| 941 | # ifdef __USE_GNU | |
| 942 | extern 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 | 948 | /* Unlock RWLOCK. */ |
| 928 | 949 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) |
| 929 | 950 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -1003,6 +1024,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 1003 | 1024 | 				 const struct timespec *__restrict __abstime) |
| 1004 | 1025 | __nonnull ((1, 2, 3)); |
| 1005 | 1026 | |
| 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. */ | |
| 1035 | extern 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 | 1042 | /* Functions for handling condition variable attributes. */ |
| 1007 | 1043 | |
| 1008 | 1044 | /* Initialize condition variable attribute ATTR. */ |
lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h+1-1| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | #define	ENTRY(name)							 \ |
| 33 | 33 | .globl C_SYMBOL_NAME(name);						 \ |
| 34 | 34 | .type C_SYMBOL_NAME(name),@function;					 \ |
| 35 | .align ALIGNARG(2);							 \ | |
| 35 | .align ALIGNARG(4);							 \ | |
| 36 | 36 | C_LABEL(name)								 \ |
| 37 | 37 | cfi_startproc;							 \ |
| 38 | 38 | CALL_MCOUNT |
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-1| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | #define	ENTRY(name)							 \ |
| 33 | 33 | .globl C_SYMBOL_NAME(name);						 \ |
| 34 | 34 | .type C_SYMBOL_NAME(name),@function;					 \ |
| 35 | .align ALIGNARG(2);							 \ | |
| 35 | .align ALIGNARG(4);							 \ | |
| 36 | 36 | C_LABEL(name)								 \ |
| 37 | 37 | cfi_startproc;							 \ |
| 38 | 38 | CALL_MCOUNT |
lib/libc/glibc/sysdeps/unix/alpha/sysdep.h+1-1| ... | ... | @@ -200,7 +200,7 @@ __LABEL(name)						\ |
| 200 | 200 | no matter what the "real" sign of the 32-bit type. We want to |
| 201 | 201 | preserve that when filling in values for the kernel. */ |
| 202 | 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)) | |
| 204 | 204 | |
| 205 | 205 | /* Make sure and "use" the variable that we're not returning, |
| 206 | 206 | in order to suppress unused variable warnings. */ |
lib/libc/glibc/sysdeps/unix/sysdep.h+1-1| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | <http://www.gnu.org/licenses/>. */ |
| 17 | 17 | |
| 18 | 18 | #include <sysdeps/generic/sysdep.h> |
| 19 | ||
| 19 | #include <single-thread.h> | |
| 20 | 20 | #include <sys/syscall.h> |
| 21 | 21 | #define	HAVE_SYSCALLS |
| 22 | 22 |
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+3-3| ... | ... | @@ -255,9 +255,9 @@ |
| 255 | 255 | #endif	/* __ASSEMBLER__ */ |
| 256 | 256 | |
| 257 | 257 | /* Pointer mangling is supported for AArch64. */ |
| 258 | #if (IS_IN (rtld) || \ | |
| 259 | (!defined SHARED && (IS_IN (libc) \ | |
| 260 | 			 || IS_IN (libpthread)))) | |
| 258 | #if (IS_IN (rtld) \ | |
| 259 | || (!defined SHARED && (IS_IN (libc) \ | |
| 260 | 			 || IS_IN (libpthread)))) | |
| 261 | 261 | # ifdef __ASSEMBLER__ |
| 262 | 262 | /* Note, dst, src, guard, and tmp are all register numbers rather than |
| 263 | 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 | 22 | |
| 23 | 23 | #include_next <kernel-features.h> |
| 24 | 24 | |
| 25 | /* There never has been support for fstat64. */ | |
| 26 | #undef __ASSUME_STATFS64 | |
| 27 | #define __ASSUME_STATFS64 0 | |
| 25 | /* Support for statfs64 was added in 5.1. */ | |
| 26 | #if __LINUX_KERNEL_VERSION < 0x050100 | |
| 27 | # undef __ASSUME_STATFS64 | |
| 28 | # define __ASSUME_STATFS64 0 | |
| 29 | #endif | |
| 28 | 30 | |
| 29 | /* Alpha defines SysV ipc shmat syscall with a different name. */ | |
| 30 | #define __NR_shmat __NR_osf_shmat | |
| 31 | /* Alpha used to define SysV ipc shmat syscall with a different name. */ | |
| 32 | #ifndef __NR_shmat | |
| 33 | # define __NR_shmat __NR_osf_shmat | |
| 34 | #endif | |
| 31 | 35 | |
| 32 | 36 | #define __ASSUME_RECV_SYSCALL	1 |
| 33 | 37 | #define __ASSUME_SEND_SYSCALL	1 |
| ... | ... | @@ -45,7 +49,6 @@ |
| 45 | 49 | /* Support for copy_file_range, statx was added in kernel 4.13. */ |
| 46 | 50 | #if __LINUX_KERNEL_VERSION < 0x040D00 |
| 47 | 51 | # undef __ASSUME_MLOCK2 |
| 48 | # undef __ASSUME_COPY_FILE_RANGE | |
| 49 | 52 | # undef __ASSUME_STATX |
| 50 | 53 | #endif |
| 51 | 54 |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h+3-1| ... | ... | @@ -51,7 +51,9 @@ |
| 51 | 51 | * Some syscalls no Linux program should know about: |
| 52 | 52 | */ |
| 53 | 53 | #define __NR_osf_sigprocmask	 48 |
| 54 | #define __NR_osf_shmat		209 | |
| 54 | #ifndef __NR_osf_shmat | |
| 55 | # define __NR_osf_shmat		209 | |
| 56 | #endif | |
| 55 | 57 | #define __NR_osf_getsysinfo	256 |
| 56 | 58 | #define __NR_osf_setsysinfo	257 |
| 57 | 59 |
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h-1| ... | ... | @@ -45,7 +45,6 @@ |
| 45 | 45 | present in 32-bit kernels from 4.4 and 4.5 respectively. */ |
| 46 | 46 | #if __LINUX_KERNEL_VERSION < 0x040700 |
| 47 | 47 | # undef __ASSUME_MLOCK2 |
| 48 | # undef __ASSUME_COPY_FILE_RANGE | |
| 49 | 48 | #endif |
| 50 | 49 | |
| 51 | 50 | #undef __ASSUME_CLONE_DEFAULT |
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h+2-2| ... | ... | @@ -104,7 +104,7 @@ struct timex |
| 104 | 104 | #define STA_CLK		0x8000	/* clock source (0 = A, 1 = B) (ro) */ |
| 105 | 105 | |
| 106 | 106 | /* Read-only bits */ |
| 107 | #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ | |
| 108 | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) | |
| 107 | #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER \ | |
| 108 | | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) | |
| 109 | 109 | |
| 110 | 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 | 746 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 747 | 747 | #endif |
| 748 | 748 | |
| 749 | #ifdef __USE_GNU | |
| 750 | extern 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 | 756 | /* Unlock a mutex. */ |
| 750 | 757 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) |
| 751 | 758 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -885,6 +892,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 885 | 892 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 886 | 893 | # endif |
| 887 | 894 | |
| 895 | # ifdef __USE_GNU | |
| 896 | extern 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 | 902 | /* Acquire write lock for RWLOCK. */ |
| 889 | 903 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) |
| 890 | 904 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -900,6 +914,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 900 | 914 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 901 | 915 | # endif |
| 902 | 916 | |
| 917 | # ifdef __USE_GNU | |
| 918 | extern 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 | 924 | /* Unlock RWLOCK. */ |
| 904 | 925 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) |
| 905 | 926 | __THROWNL __nonnull ((1)); |
| ... | ... | @@ -979,6 +1000,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 979 | 1000 | 				 const struct timespec *__restrict __abstime) |
| 980 | 1001 | __nonnull ((1, 2, 3)); |
| 981 | 1002 | |
| 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. */ | |
| 1011 | extern 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 | 1018 | /* Functions for handling condition variable attributes. */ |
| 983 | 1019 | |
| 984 | 1020 | /* Initialize condition variable attribute ATTR. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h+4-2| ... | ... | @@ -26,8 +26,10 @@ |
| 26 | 26 | #define __ASSUME_SEND_SYSCALL		1 |
| 27 | 27 | #define __ASSUME_ACCEPT4_SYSCALL	1 |
| 28 | 28 | |
| 29 | /* No statx system call on ia64 yet. */ | |
| 30 | #undef __ASSUME_STATX | |
| 29 | /* Support for statx was added in 5.1. */ | |
| 30 | #if __LINUX_KERNEL_VERSION < 0x050100 | |
| 31 | # undef __ASSUME_STATX | |
| 32 | #endif | |
| 31 | 33 | |
| 32 | 34 | #undef __ASSUME_CLONE_DEFAULT |
| 33 | 35 | #define __ASSUME_CLONE2 |
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h-7| ... | ... | @@ -57,9 +57,6 @@ |
| 57 | 57 | 2.6.27. */ |
| 58 | 58 | #define __ASSUME_IN_NONBLOCK	1 |
| 59 | 59 | |
| 60 | /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */ | |
| 61 | #define __ASSUME_FUTEX_CLOCK_REALTIME	1 | |
| 62 | ||
| 63 | 60 | /* Support for preadv and pwritev was added in 2.6.30. */ |
| 64 | 61 | #define __ASSUME_PREADV	1 |
| 65 | 62 | #define __ASSUME_PWRITEV	1 |
| ... | ... | @@ -103,10 +100,6 @@ |
| 103 | 100 | # define __ASSUME_MLOCK2 1 |
| 104 | 101 | #endif |
| 105 | 102 | |
| 106 | #if __LINUX_KERNEL_VERSION >= 0x040500 | |
| 107 | # define __ASSUME_COPY_FILE_RANGE 1 | |
| 108 | #endif | |
| 109 | ||
| 110 | 103 | /* Support for statx was added in kernel 4.11. */ |
| 111 | 104 | #if __LINUX_KERNEL_VERSION >= 0x040B00 |
| 112 | 105 | # define __ASSUME_STATX 1 |
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h-5| ... | ... | @@ -60,11 +60,6 @@ |
| 60 | 60 | # undef __ASSUME_MLOCK2 |
| 61 | 61 | #endif |
| 62 | 62 | |
| 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 | 63 | /* Support for statx was added in kernel 4.12. */ |
| 69 | 64 | #if __LINUX_KERNEL_VERSION < 0X040C00 |
| 70 | 65 | # undef __ASSUME_STATX |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h+3-3| ... | ... | @@ -233,9 +233,9 @@ |
| 233 | 233 | |
| 234 | 234 | #undef INTERNAL_SYSCALL |
| 235 | 235 | #define INTERNAL_SYSCALL(name, err, nr, args...)			 \ |
| 236 | (((__NR_##name) < 256) ?						 \ | |
| 237 | INTERNAL_SYSCALL_DIRECT(name, err, nr, args) :			 \ | |
| 238 | INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 236 | (((__NR_##name) < 256)						 \ | |
| 237 | ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args)			 \ | |
| 238 | : INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 239 | 239 | |
| 240 | 240 | #undef INTERNAL_SYSCALL_ERROR_P |
| 241 | 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 | 239 | |
| 240 | 240 | #undef INTERNAL_SYSCALL |
| 241 | 241 | #define INTERNAL_SYSCALL(name, err, nr, args...)			 \ |
| 242 | (((__NR_##name) < 256) ?						 \ | |
| 243 | INTERNAL_SYSCALL_DIRECT(name, err, nr, args) :			 \ | |
| 244 | INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 242 | (((__NR_##name) < 256)						 \ | |
| 243 | ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args)			 \ | |
| 244 | : INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 245 | 245 | |
| 246 | 246 | #undef INTERNAL_SYSCALL_ERROR_P |
| 247 | 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 | 49 | # undef __ASSUME_RENAMEAT2 |
| 50 | 50 | # undef __ASSUME_EXECVEAT |
| 51 | 51 | # undef __ASSUME_MLOCK2 |
| 52 | # undef __ASSUME_COPY_FILE_RANGE | |
| 53 | 52 | #endif |
| 54 | 53 | |
| 55 | /* sh does not support the statx system call. */ | |
| 56 | #undef __ASSUME_STATX | |
| 54 | /* sh does not support the statx system call before 5.1. */ | |
| 55 | #if __LINUX_KERNEL_VERSION < 0x050100 | |
| 56 | # undef __ASSUME_STATX | |
| 57 | #endif | |
| 57 | 58 | |
| 58 | 59 | #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) | |
| 32 | extern int __libc_multiple_threads; | |
| 33 | # define SINGLE_THREAD_P \ | |
| 34 | __glibc_likely (__libc_multiple_threads == 0) | |
| 35 | # elif IS_IN (libpthread) | |
| 36 | extern 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 */ |