mirror of
https://github.com/ziglang/zig.git
synced 2025-02-01 14:55:08 +00:00
commit
9f46abf598
36
lib/libc/glibc/bits/libc-header-start.h
vendored
36
lib/libc/glibc/bits/libc-header-start.h
vendored
@ -44,23 +44,23 @@
|
||||
|
||||
/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
macro. Most but not all symbols enabled by that macro in TS
|
||||
18661-1 are enabled unconditionally in C2X. In C2X, the symbols in
|
||||
18661-1 are enabled unconditionally in C23. In C23, the symbols in
|
||||
Annex F still require a new feature test macro
|
||||
__STDC_WANT_IEC_60559_EXT__ instead (C2X does not define
|
||||
__STDC_WANT_IEC_60559_EXT__ instead (C23 does not define
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS
|
||||
18661-1 are not included in C2X (and thus should depend on
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are
|
||||
18661-1 are not included in C23 (and thus should depend on
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are
|
||||
enabled).
|
||||
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS
|
||||
18661-1 not included in C2X.
|
||||
18661-1 not included in C23.
|
||||
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS
|
||||
18661-1 that are also included in C2X (with no feature test macro
|
||||
required in C2X).
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS
|
||||
18661-1 that are also included in C23 (with no feature test macro
|
||||
required in C23).
|
||||
|
||||
__GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1
|
||||
that are included in C2X but conditional on
|
||||
that are included in C23 but conditional on
|
||||
__STDC_WANT_IEC_60559_EXT__. (There are currently no features
|
||||
conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS
|
||||
18661-1.) */
|
||||
@ -70,11 +70,11 @@
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1
|
||||
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C23
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23)
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_EXT
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__
|
||||
@ -86,18 +86,18 @@
|
||||
/* ISO/IEC TS 18661-4:2015 defines the
|
||||
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
|
||||
functions, the symbols from this TS are enabled unconditionally in
|
||||
C2X. */
|
||||
C23. */
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT
|
||||
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X)
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23)
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0
|
||||
#endif
|
||||
|
||||
/* ISO/IEC TS 18661-3:2015 defines the
|
||||
|
33
lib/libc/glibc/elf/elf.h
vendored
33
lib/libc/glibc/elf/elf.h
vendored
@ -831,6 +831,10 @@ typedef struct
|
||||
control. */
|
||||
#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* AArch64 pointer authentication
|
||||
enabled keys. */
|
||||
#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers. */
|
||||
#define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */
|
||||
#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */
|
||||
#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */
|
||||
#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
|
||||
#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
|
||||
#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
|
||||
@ -1234,6 +1238,10 @@ typedef struct
|
||||
#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */
|
||||
#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */
|
||||
|
||||
/* More machine-dependent hints about processor capabilities. */
|
||||
#define AT_HWCAP3 29 /* extension of AT_HWCAP. */
|
||||
#define AT_HWCAP4 30 /* extension of AT_HWCAP. */
|
||||
|
||||
#define AT_EXECFN 31 /* Filename of executable. */
|
||||
|
||||
/* Pointer to the global system page used for system calls and other
|
||||
@ -1333,9 +1341,13 @@ typedef struct
|
||||
#define NT_GNU_PROPERTY_TYPE_0 5
|
||||
|
||||
/* Packaging metadata as defined on
|
||||
https://systemd.io/COREDUMP_PACKAGE_METADATA/ */
|
||||
https://systemd.io/ELF_PACKAGE_METADATA/ */
|
||||
#define NT_FDO_PACKAGING_METADATA 0xcafe1a7e
|
||||
|
||||
/* dlopen metadata as defined on
|
||||
https://systemd.io/ELF_DLOPEN_METADATA/ */
|
||||
#define NT_FDO_DLOPEN_METADATA 0x407c0c0a
|
||||
|
||||
/* Note section name of program property. */
|
||||
#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
|
||||
|
||||
@ -4237,6 +4249,8 @@ enum
|
||||
#define R_LARCH_TLS_TPREL32 10
|
||||
#define R_LARCH_TLS_TPREL64 11
|
||||
#define R_LARCH_IRELATIVE 12
|
||||
#define R_LARCH_TLS_DESC32 13
|
||||
#define R_LARCH_TLS_DESC64 14
|
||||
|
||||
/* Reserved for future relocs that the dynamic linker must understand. */
|
||||
|
||||
@ -4331,6 +4345,23 @@ enum
|
||||
#define R_LARCH_ADD_ULEB128 107
|
||||
#define R_LARCH_SUB_ULEB128 108
|
||||
#define R_LARCH_64_PCREL 109
|
||||
#define R_LARCH_CALL36 110
|
||||
#define R_LARCH_TLS_DESC_PC_HI20 111
|
||||
#define R_LARCH_TLS_DESC_PC_LO12 112
|
||||
#define R_LARCH_TLS_DESC64_PC_LO20 113
|
||||
#define R_LARCH_TLS_DESC64_PC_HI12 114
|
||||
#define R_LARCH_TLS_DESC_HI20 115
|
||||
#define R_LARCH_TLS_DESC_LO12 116
|
||||
#define R_LARCH_TLS_DESC64_LO20 117
|
||||
#define R_LARCH_TLS_DESC64_HI12 118
|
||||
#define R_LARCH_TLS_DESC_LD 119
|
||||
#define R_LARCH_TLS_DESC_CALL 120
|
||||
#define R_LARCH_TLS_LE_HI20_R 121
|
||||
#define R_LARCH_TLS_LE_ADD_R 122
|
||||
#define R_LARCH_TLS_LE_LO12_R 123
|
||||
#define R_LARCH_TLS_LD_PCREL20_S2 124
|
||||
#define R_LARCH_TLS_GD_PCREL20_S2 125
|
||||
#define R_LARCH_TLS_DESC_PCREL20_S2 126
|
||||
|
||||
/* ARC specific declarations. */
|
||||
|
||||
|
28
lib/libc/glibc/include/libc-symbols.h
vendored
28
lib/libc/glibc/include/libc-symbols.h
vendored
@ -679,9 +679,9 @@ for linking")
|
||||
#endif
|
||||
|
||||
/* Helper / base macros for indirect function symbols. */
|
||||
#define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
|
||||
#define __ifunc_resolver(type_name, name, expr, init, classifier, ...) \
|
||||
classifier inhibit_stack_protector \
|
||||
__typeof (type_name) *name##_ifunc (arg) \
|
||||
__typeof (type_name) *name##_ifunc (__VA_ARGS__) \
|
||||
{ \
|
||||
init (); \
|
||||
__typeof (type_name) *res = expr; \
|
||||
@ -689,13 +689,13 @@ for linking")
|
||||
}
|
||||
|
||||
#ifdef HAVE_GCC_IFUNC
|
||||
# define __ifunc(type_name, name, expr, arg, init) \
|
||||
# define __ifunc_args(type_name, name, expr, init, ...) \
|
||||
extern __typeof (type_name) name __attribute__ \
|
||||
((ifunc (#name "_ifunc"))); \
|
||||
__ifunc_resolver (type_name, name, expr, arg, init, static)
|
||||
__ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__)
|
||||
|
||||
# define __ifunc_hidden(type_name, name, expr, arg, init) \
|
||||
__ifunc (type_name, name, expr, arg, init)
|
||||
# define __ifunc_args_hidden(type_name, name, expr, init, ...) \
|
||||
__ifunc_args (type_name, name, expr, init, __VA_ARGS__)
|
||||
#else
|
||||
/* Gcc does not support __attribute__ ((ifunc (...))). Use the old behaviour
|
||||
as fallback. But keep in mind that the debug information for the ifunc
|
||||
@ -706,18 +706,24 @@ for linking")
|
||||
different signatures. (Gcc support is disabled at least on a ppc64le
|
||||
Ubuntu 14.04 system.) */
|
||||
|
||||
# define __ifunc(type_name, name, expr, arg, init) \
|
||||
# define __ifunc_args(type_name, name, expr, init, ...) \
|
||||
extern __typeof (type_name) name; \
|
||||
__typeof (type_name) *name##_ifunc (arg) __asm__ (#name); \
|
||||
__ifunc_resolver (type_name, name, expr, arg, init,) \
|
||||
__typeof (type_name) *name##_ifunc (__VA_ARGS__) __asm__ (#name); \
|
||||
__ifunc_resolver (type_name, name, expr, init, , __VA_ARGS__) \
|
||||
__asm__ (".type " #name ", %gnu_indirect_function");
|
||||
|
||||
# define __ifunc_hidden(type_name, name, expr, arg, init) \
|
||||
# define __ifunc_args_hidden(type_name, name, expr, init, ...) \
|
||||
extern __typeof (type_name) __libc_##name; \
|
||||
__ifunc (type_name, __libc_##name, expr, arg, init) \
|
||||
__ifunc (type_name, __libc_##name, expr, __VA_ARGS__, init) \
|
||||
strong_alias (__libc_##name, name);
|
||||
#endif /* !HAVE_GCC_IFUNC */
|
||||
|
||||
#define __ifunc(type_name, name, expr, arg, init) \
|
||||
__ifunc_args (type_name, name, expr, init, arg)
|
||||
|
||||
#define __ifunc_hidden(type_name, name, expr, arg, init) \
|
||||
__ifunc_args_hidden (type_name, name, expr, init, arg)
|
||||
|
||||
/* The following macros are used for indirect function symbols in libc.so.
|
||||
First of all, you need to have the function prototyped somewhere,
|
||||
say in foo.h:
|
||||
|
4
lib/libc/glibc/include/stdlib.h
vendored
4
lib/libc/glibc/include/stdlib.h
vendored
@ -53,8 +53,8 @@ libc_hidden_proto (__isoc23_strtoul_l)
|
||||
libc_hidden_proto (__isoc23_strtoll_l)
|
||||
libc_hidden_proto (__isoc23_strtoull_l)
|
||||
|
||||
#if __GLIBC_USE (C2X_STRTOL)
|
||||
/* Redirect internal uses of these functions to the C2X versions; the
|
||||
#if __GLIBC_USE (C23_STRTOL)
|
||||
/* Redirect internal uses of these functions to the C23 versions; the
|
||||
redirection in the installed header does not work with
|
||||
libc_hidden_proto. */
|
||||
# undef strtol
|
||||
|
7
lib/libc/glibc/io/fcntl.h
vendored
7
lib/libc/glibc/io/fcntl.h
vendored
@ -176,7 +176,7 @@ typedef __pid_t pid_t;
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME_BITS64
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int fcntl (int __fd, int __cmd, ...);
|
||||
# else
|
||||
@ -189,7 +189,7 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int fcntl64 (int __fd, int __cmd, ...);
|
||||
# endif
|
||||
#else /* __USE_TIME_BITS64 */
|
||||
#else /* __USE_TIME64_REDIRECTS */
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
|
||||
__fcntl_time64);
|
||||
@ -344,8 +344,7 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
|
||||
|
||||
|
||||
/* Define some inlines helping to catch common problems. */
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \
|
||||
&& defined __va_arg_pack_len
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
|
||||
# include <bits/fcntl2.h>
|
||||
#endif
|
||||
|
||||
|
16
lib/libc/glibc/io/sys/stat.h
vendored
16
lib/libc/glibc/io/sys/stat.h
vendored
@ -209,7 +209,7 @@ extern int stat (const char *__restrict __file,
|
||||
that file descriptor FD is open on and put them in BUF. */
|
||||
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
|
||||
struct stat *__restrict __buf),
|
||||
@ -236,7 +236,7 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int stat64 (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
|
||||
@ -265,7 +265,7 @@ extern int fstatat (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((2, 3));
|
||||
# else
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf,
|
||||
@ -287,7 +287,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int fstatat64 (int __fd, const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((2, 3));
|
||||
@ -313,7 +313,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd,
|
||||
extern int lstat (const char *__restrict __file,
|
||||
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
# else
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (lstat,
|
||||
(const char *__restrict __file,
|
||||
@ -334,7 +334,7 @@ extern int __REDIRECT_NTH (lstat,
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int lstat64 (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
@ -427,7 +427,7 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set file access and modification times relative to directory file
|
||||
descriptor. */
|
||||
extern int utimensat (int __fd, const char *__path,
|
||||
@ -447,7 +447,7 @@ extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set file access and modification times of the file associated with FD. */
|
||||
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
|
||||
|
||||
|
173
lib/libc/glibc/misc/sys/cdefs.h
vendored
173
lib/libc/glibc/misc/sys/cdefs.h
vendored
@ -145,6 +145,14 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* The overloadable attribute was added on clang 2.6. */
|
||||
#if defined __clang_major__ \
|
||||
&& (__clang_major__ + (__clang_minor__ >= 6) > 2)
|
||||
# define __attribute_overloadable__ __attribute__((__overloadable__))
|
||||
#else
|
||||
# define __attribute_overloadable__
|
||||
#endif
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
@ -187,27 +195,173 @@
|
||||
__s, __osz)) \
|
||||
&& !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
|
||||
|
||||
/* To correctly instrument the fortify wrapper clang requires the
|
||||
pass_object_size attribute, and the attribute has the restriction that the
|
||||
argument needs to be 'const'. Furthermore, to make it usable with C
|
||||
interfaces, clang provides the overload attribute, which provides a C++
|
||||
like function overload support. The overloaded fortify wrapper with the
|
||||
pass_object_size attribute has precedence over the default symbol.
|
||||
|
||||
Also, clang does not support __va_arg_pack, so variadic functions are
|
||||
expanded to issue va_arg implementations. The error function must not have
|
||||
bodies (address takes are expanded to nonfortified calls), and with
|
||||
__fortify_function compiler might still create a body with the C++
|
||||
mangling name (due to the overload attribute). In this case, the function
|
||||
is defined with __fortify_function_error_function macro instead.
|
||||
|
||||
The argument size check is also done with a clang-only attribute,
|
||||
__attribute__ ((__diagnose_if__ (...))), different than gcc which calls
|
||||
symbol_chk_warn alias with uses __warnattr attribute.
|
||||
|
||||
The pass_object_size was added on clang 4.0, __diagnose_if__ on 5.0,
|
||||
and pass_dynamic_object_size on 9.0. */
|
||||
#if defined __clang_major__ && __clang_major__ >= 5
|
||||
# define __fortify_use_clang 1
|
||||
|
||||
# define __fortify_function_error_function static __attribute__((__unused__))
|
||||
|
||||
# define __fortify_clang_pass_object_size_n(n) \
|
||||
__attribute__ ((__pass_object_size__ (n)))
|
||||
# define __fortify_clang_pass_object_size0 \
|
||||
__fortify_clang_pass_object_size_n (0)
|
||||
# define __fortify_clang_pass_object_size \
|
||||
__fortify_clang_pass_object_size_n (__USE_FORTIFY_LEVEL > 1)
|
||||
|
||||
# if __clang_major__ >= 9
|
||||
# define __fortify_clang_pass_dynamic_object_size_n(n) \
|
||||
__attribute__ ((__pass_dynamic_object_size__ (n)))
|
||||
# define __fortify_clang_pass_dynamic_object_size0 \
|
||||
__fortify_clang_pass_dynamic_object_size_n (0)
|
||||
# define __fortify_clang_pass_dynamic_object_size \
|
||||
__fortify_clang_pass_dynamic_object_size_n (1)
|
||||
# else
|
||||
# define __fortify_clang_pass_dynamic_object_size_n(n)
|
||||
# define __fortify_clang_pass_dynamic_object_size0
|
||||
# define __fortify_clang_pass_dynamic_object_size
|
||||
# endif
|
||||
|
||||
# define __fortify_clang_bos_static_lt_impl(bos_val, n, s) \
|
||||
((bos_val) != -1ULL && (n) > (bos_val) / (s))
|
||||
# define __fortify_clang_bos_static_lt2(__n, __e, __s) \
|
||||
__fortify_clang_bos_static_lt_impl (__bos (__e), __n, __s)
|
||||
# define __fortify_clang_bos_static_lt(__n, __e) \
|
||||
__fortify_clang_bos_static_lt2 (__n, __e, 1)
|
||||
# define __fortify_clang_bos0_static_lt2(__n, __e, __s) \
|
||||
__fortify_clang_bos_static_lt_impl (__bos0 (__e), __n, __s)
|
||||
# define __fortify_clang_bos0_static_lt(__n, __e) \
|
||||
__fortify_clang_bos0_static_lt2 (__n, __e, 1)
|
||||
|
||||
# define __fortify_clang_bosn_args(bos_fn, n, buf, div, complaint) \
|
||||
(__fortify_clang_bos_static_lt_impl (bos_fn (buf), n, div)), (complaint), \
|
||||
"warning"
|
||||
|
||||
# define __fortify_clang_warning(__c, __msg) \
|
||||
__attribute__ ((__diagnose_if__ ((__c), (__msg), "warning")))
|
||||
# define __fortify_clang_error(__c, __msg) \
|
||||
__attribute__ ((__diagnose_if__ ((__c), (__msg), "error")))
|
||||
# define __fortify_clang_warning_only_if_bos0_lt(n, buf, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos0, n, buf, 1, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos0_lt2(n, buf, div, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos0, n, buf, div, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos_lt(n, buf, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos, n, buf, 1, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos_lt2(n, buf, div, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos, n, buf, div, complaint))))
|
||||
|
||||
# define __fortify_clang_prefer_this_overload \
|
||||
__attribute__ ((enable_if (1, "")))
|
||||
# define __fortify_clang_unavailable(__msg) \
|
||||
__attribute__ ((unavailable(__msg)))
|
||||
|
||||
# if __USE_FORTIFY_LEVEL == 3
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_dynamic_object_size __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_dynamic_object_size0 __name
|
||||
# else
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_object_size __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_object_size0 __name
|
||||
# endif
|
||||
|
||||
# define __fortify_clang_mul_may_overflow(size, n) \
|
||||
((size | n) >= (((size_t)1) << (8 * sizeof (size_t) / 2)))
|
||||
|
||||
# define __fortify_clang_size_too_small(__bos, __dest, __len) \
|
||||
(__bos (__dest) != (size_t) -1 && __bos (__dest) < __len)
|
||||
# define __fortify_clang_warn_if_src_too_large(__dest, __src) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \
|
||||
__dest, \
|
||||
__builtin_strlen (__src) + 1), \
|
||||
"destination buffer will always be overflown by source")
|
||||
# define __fortify_clang_warn_if_dest_too_small(__dest, __len) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \
|
||||
__dest, \
|
||||
__len), \
|
||||
"function called with bigger length than the destination buffer")
|
||||
# define __fortify_clang_warn_if_dest_too_small0(__dest, __len) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize0, \
|
||||
__dest, \
|
||||
__len), \
|
||||
"function called with bigger length than the destination buffer")
|
||||
#else
|
||||
# define __fortify_use_clang 0
|
||||
# define __fortify_clang_warning(__c, __msg)
|
||||
# define __fortify_clang_warning_only_if_bos0_lt(__n, __buf, __complaint)
|
||||
# define __fortify_clang_warning_only_if_bos0_lt2(__n, __buf, __div, complaint)
|
||||
# define __fortify_clang_warning_only_if_bos_lt(__n, __buf, __complaint)
|
||||
# define __fortify_clang_warning_only_if_bos_lt2(__n, __buf, div, __complaint)
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__fortify_clang_overload_arg (__type, __attr, __name)
|
||||
# define __fortify_clang_warn_if_src_too_large(__dest, __src)
|
||||
# define __fortify_clang_warn_if_dest_too_small(__dest, __len)
|
||||
# define __fortify_clang_warn_if_dest_too_small0(__dest, __len)
|
||||
#endif
|
||||
|
||||
|
||||
/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
|
||||
declared. */
|
||||
|
||||
#define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
#if !__fortify_use_clang
|
||||
# define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, __osz)))
|
||||
#else
|
||||
# define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
(__osz == (__SIZE_TYPE__) -1) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, __osz)
|
||||
#endif
|
||||
|
||||
/* Fortify function f, where object size argument passed to f is the number of
|
||||
elements and not total size. */
|
||||
|
||||
#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
#if !__fortify_use_clang
|
||||
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
|
||||
# else
|
||||
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
(__osz == (__SIZE_TYPE__) -1) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))
|
||||
#endif
|
||||
|
||||
#endif /* __USE_FORTIFY_LEVEL > 0 */
|
||||
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __warnattr(msg) __attribute__((__warning__ (msg)))
|
||||
# define __errordecl(name, msg) \
|
||||
@ -683,10 +837,10 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
|
||||
# define __attr_access(x) __attribute__ ((__access__ x))
|
||||
/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
|
||||
use the access attribute to get object sizes from function definition
|
||||
arguments, so we can't use them on functions we fortify. Drop the object
|
||||
size hints for such functions. */
|
||||
arguments, so we can't use them on functions we fortify. Drop the access
|
||||
attribute for such functions. */
|
||||
# if __USE_FORTIFY_LEVEL == 3
|
||||
# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o)))
|
||||
# define __fortified_attr_access(a, o, s)
|
||||
# else
|
||||
# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
|
||||
# endif
|
||||
@ -720,4 +874,13 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
|
||||
# define __attribute_returns_twice__ /* Ignore. */
|
||||
#endif
|
||||
|
||||
/* Mark struct types as aliasable. Restricted to compilers that
|
||||
support forward declarations of structs in the presence of the
|
||||
attribute. */
|
||||
#if __GNUC_PREREQ (7, 1) || defined __clang__
|
||||
# define __attribute_struct_may_alias__ __attribute__ ((__may_alias__))
|
||||
#else
|
||||
# define __attribute_struct_may_alias__
|
||||
#endif
|
||||
|
||||
#endif /* sys/cdefs.h */
|
||||
|
4
lib/libc/glibc/misc/sys/select.h
vendored
4
lib/libc/glibc/misc/sys/select.h
vendored
@ -98,7 +98,7 @@ __BEGIN_DECLS
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME_BITS64
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int select (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
@ -123,7 +123,7 @@ extern int __REDIRECT (select,
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pselect (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
|
2
lib/libc/glibc/signal/signal.h
vendored
2
lib/libc/glibc/signal/signal.h
vendored
@ -269,7 +269,7 @@ extern int sigwaitinfo (const sigset_t *__restrict __set,
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int sigtimedwait (const sigset_t *__restrict __set,
|
||||
siginfo_t *__restrict __info,
|
||||
const struct timespec *__restrict __timeout)
|
||||
|
6
lib/libc/glibc/stdlib/stdlib.h
vendored
6
lib/libc/glibc/stdlib/stdlib.h
vendored
@ -210,7 +210,7 @@ extern unsigned long long int strtoull (const char *__restrict __nptr,
|
||||
|
||||
/* Versions of the above functions that handle '0b' and '0B' prefixes
|
||||
in base 0 or 2. */
|
||||
#if __GLIBC_USE (C2X_STRTOL)
|
||||
#if __GLIBC_USE (C23_STRTOL)
|
||||
# ifdef __REDIRECT
|
||||
extern long int __REDIRECT_NTH (strtol, (const char *__restrict __nptr,
|
||||
char **__restrict __endptr,
|
||||
@ -274,7 +274,7 @@ extern unsigned long long int __isoc23_strtoull (const char *__restrict __nptr,
|
||||
#endif
|
||||
|
||||
/* Convert a floating-point number to a string. */
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
extern int strfromd (char *__dest, size_t __size, const char *__format,
|
||||
double __f)
|
||||
__THROW __nonnull ((3));
|
||||
@ -360,7 +360,7 @@ extern unsigned long long int strtoull_l (const char *__restrict __nptr,
|
||||
|
||||
/* Versions of the above functions that handle '0b' and '0B' prefixes
|
||||
in base 0 or 2. */
|
||||
# if __GLIBC_USE (C2X_STRTOL)
|
||||
# if __GLIBC_USE (C23_STRTOL)
|
||||
# ifdef __REDIRECT
|
||||
extern long int __REDIRECT_NTH (strtol_l, (const char *__restrict __nptr,
|
||||
char **__restrict __endptr,
|
||||
|
11
lib/libc/glibc/sysdeps/htl/pthread.h
vendored
11
lib/libc/glibc/sysdeps/htl/pthread.h
vendored
@ -891,6 +891,17 @@ extern int pthread_setschedparam (pthread_t __thr, int __policy,
|
||||
/* Set thread THREAD's scheduling priority. */
|
||||
extern int pthread_setschedprio (pthread_t __thr, int __prio) __THROW;
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Get thread name visible in the kernel and its interfaces. */
|
||||
extern int pthread_getname_np (pthread_t __target_thread, char *__buf,
|
||||
size_t __buflen)
|
||||
__THROW __nonnull ((2)) __attr_access ((__write_only__, 2));
|
||||
|
||||
/* Set thread name visible in the kernel and its interfaces. */
|
||||
extern int pthread_setname_np (pthread_t __target_thread, const char *__name)
|
||||
__THROW __nonnull ((2)) __attr_access ((__read_only__, 2));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Yield the processor to another thread or process.
|
||||
This function is similar to the POSIX `sched_yield' function but
|
||||
|
18
lib/libc/glibc/sysdeps/nptl/pthread.h
vendored
18
lib/libc/glibc/sysdeps/nptl/pthread.h
vendored
@ -223,7 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return);
|
||||
the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */
|
||||
extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
|
||||
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Make calling thread wait for termination of the thread TH, but only
|
||||
until TIMEOUT. The exit status of the thread is stored in
|
||||
*THREAD_RETURN, if THREAD_RETURN is not NULL.
|
||||
@ -796,7 +796,7 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* Wait until lock becomes available, or specified time passes. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
|
||||
const struct timespec *__restrict
|
||||
__abstime) __THROWNL __nonnull ((1, 2));
|
||||
@ -813,7 +813,7 @@ extern int __REDIRECT_NTHNL (pthread_mutex_timedlock,
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
|
||||
clockid_t __clockid,
|
||||
const struct timespec *__restrict
|
||||
@ -982,7 +982,7 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
|
||||
|
||||
# ifdef __USE_XOPEN2K
|
||||
/* Try to acquire read lock for RWLOCK or return after specified time. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
|
||||
const struct timespec *__restrict
|
||||
__abstime) __THROWNL __nonnull ((1, 2));
|
||||
@ -1000,7 +1000,7 @@ extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock,
|
||||
# endif
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
|
||||
clockid_t __clockid,
|
||||
const struct timespec *__restrict
|
||||
@ -1029,7 +1029,7 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
|
||||
|
||||
# ifdef __USE_XOPEN2K
|
||||
/* Try to acquire write lock for RWLOCK or return after specified time. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
|
||||
const struct timespec *__restrict
|
||||
__abstime) __THROWNL __nonnull ((1, 2));
|
||||
@ -1047,7 +1047,7 @@ extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock,
|
||||
# endif
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
|
||||
clockid_t __clockid,
|
||||
const struct timespec *__restrict
|
||||
@ -1141,7 +1141,7 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
|
||||
pthread_mutex_t *__restrict __mutex,
|
||||
const struct timespec *__restrict __abstime)
|
||||
@ -1167,7 +1167,7 @@ extern int __REDIRECT (pthread_cond_timedwait,
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME_BITS64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
|
||||
pthread_mutex_t *__restrict __mutex,
|
||||
__clockid_t __clock_id,
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
struct timex
|
||||
{
|
||||
# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32)
|
||||
# if defined __USE_TIME64_REDIRECTS || (__TIMESIZE == 64 && __WORDSIZE == 32)
|
||||
unsigned int modes; /* mode selector */
|
||||
int :32; /* pad */
|
||||
long long offset; /* time offset (usec) */
|
||||
|
@ -468,6 +468,15 @@ L(pre_end): ASM_LINE_SEP \
|
||||
#define CLOB_ARGS_1 CLOB_ARGS_2, "%r25"
|
||||
#define CLOB_ARGS_0 CLOB_ARGS_1, "%r26"
|
||||
|
||||
#define VDSO_NAME "LINUX_6.11"
|
||||
#define VDSO_HASH 182951793
|
||||
|
||||
#ifdef __LP64__
|
||||
# define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_clock_gettime"
|
||||
#else
|
||||
# define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime64"
|
||||
#endif /* __LP64__ */
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* _LINUX_HPPA_SYSDEP_H */
|
||||
|
@ -156,6 +156,7 @@
|
||||
/* List of system calls which are supported as vsyscalls (for RV32 and
|
||||
RV64). */
|
||||
# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
|
||||
# define HAVE_RISCV_HWPROBE "__vdso_riscv_hwprobe"
|
||||
|
||||
# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
|
||||
# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
|
||||
|
@ -54,7 +54,7 @@ struct ntptimeval
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifndef __USE_TIME_BITS64
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1));
|
||||
extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW __nonnull ((1));
|
||||
|
||||
|
5
lib/libc/glibc/sysdeps/x86/bits/wordsize.h
vendored
5
lib/libc/glibc/sysdeps/x86/bits/wordsize.h
vendored
@ -8,10 +8,9 @@
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
||||
#endif
|
||||
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
|
||||
#ifdef __x86_64__
|
||||
# define __WORDSIZE_TIME64_COMPAT32 1
|
||||
/* Both x86-64 and x32 use the 64-bit system call interface. */
|
||||
# define __SYSCALL_WORDSIZE 64
|
||||
#else
|
||||
# define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#endif
|
||||
|
114
lib/libc/glibc/sysdeps/x86/sysdep.h
vendored
114
lib/libc/glibc/sysdeps/x86/sysdep.h
vendored
@ -21,14 +21,118 @@
|
||||
|
||||
#include <sysdeps/generic/sysdep.h>
|
||||
|
||||
/* The extended state feature IDs in the state component bitmap. */
|
||||
#define X86_XSTATE_X87_ID 0
|
||||
#define X86_XSTATE_SSE_ID 1
|
||||
#define X86_XSTATE_AVX_ID 2
|
||||
#define X86_XSTATE_BNDREGS_ID 3
|
||||
#define X86_XSTATE_BNDCFG_ID 4
|
||||
#define X86_XSTATE_K_ID 5
|
||||
#define X86_XSTATE_ZMM_H_ID 6
|
||||
#define X86_XSTATE_ZMM_ID 7
|
||||
#define X86_XSTATE_PKRU_ID 9
|
||||
#define X86_XSTATE_TILECFG_ID 17
|
||||
#define X86_XSTATE_TILEDATA_ID 18
|
||||
#define X86_XSTATE_APX_F_ID 19
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need
|
||||
space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be
|
||||
aligned to 16 bytes for fxsave and 64 bytes for xsave. */
|
||||
#define STATE_SAVE_OFFSET (8 * 7 + 8)
|
||||
aligned to 16 bytes for fxsave and 64 bytes for xsave. It is non-zero
|
||||
because MOV, instead of PUSH, is used to save registers onto stack.
|
||||
|
||||
/* Save SSE, AVX, AVX512, mask and bound registers. */
|
||||
#define STATE_SAVE_MASK \
|
||||
((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
|
||||
+==================+<- stack frame start aligned at 8 or 16 bytes
|
||||
| |<- paddings for stack realignment of 64 bytes
|
||||
|------------------|<- xsave buffer end aligned at 64 bytes
|
||||
| |<-
|
||||
| |<-
|
||||
| |<-
|
||||
|------------------|<- xsave buffer start at STATE_SAVE_OFFSET(%rsp)
|
||||
| |<- 8-byte padding for 64-byte alignment
|
||||
| |<- R9
|
||||
| |<- R8
|
||||
| |<- RDI
|
||||
| |<- RSI
|
||||
| |<- RDX
|
||||
| |<- RCX
|
||||
| |<- RAX
|
||||
+==================+<- RSP aligned at 64 bytes
|
||||
|
||||
*/
|
||||
# define STATE_SAVE_OFFSET (8 * 7 + 8)
|
||||
|
||||
/* _dl_tlsdesc_dynamic preserves RDI, RSI and RBX before realigning
|
||||
stack. After realigning stack, it saves RCX, RDX, R8, R9, R10 and
|
||||
R11. Allocate space for RDI, RSI and RBX to avoid clobbering saved
|
||||
RDI, RSI and RBX values on stack by xsave.
|
||||
|
||||
+==================+<- stack frame start aligned at 8 or 16 bytes
|
||||
| |<- RDI saved in the red zone
|
||||
| |<- RSI saved in the red zone
|
||||
| |<- RBX saved in the red zone
|
||||
| |<- paddings for stack realignment of 64 bytes
|
||||
|------------------|<- xsave buffer end aligned at 64 bytes
|
||||
| |<-
|
||||
| |<-
|
||||
| |<-
|
||||
|------------------|<- xsave buffer start at STATE_SAVE_OFFSET(%rsp)
|
||||
| |<- 8-byte padding for 64-byte alignment
|
||||
| |<- 8-byte padding for 64-byte alignment
|
||||
| |<- R11
|
||||
| |<- R10
|
||||
| |<- R9
|
||||
| |<- R8
|
||||
| |<- RDX
|
||||
| |<- RCX
|
||||
+==================+<- RSP aligned at 64 bytes
|
||||
|
||||
Define the total register save area size for all integer registers by
|
||||
adding 24 to STATE_SAVE_OFFSET since RDI, RSI and RBX are saved onto
|
||||
stack without adjusting stack pointer first, using the red-zone. */
|
||||
# define TLSDESC_CALL_REGISTER_SAVE_AREA (STATE_SAVE_OFFSET + 24)
|
||||
|
||||
/* Save SSE, AVX, AVX512, mask, bound and APX registers. Bound and APX
|
||||
registers are mutually exclusive. */
|
||||
# define STATE_SAVE_MASK \
|
||||
((1 << X86_XSTATE_SSE_ID) \
|
||||
| (1 << X86_XSTATE_AVX_ID) \
|
||||
| (1 << X86_XSTATE_BNDREGS_ID) \
|
||||
| (1 << X86_XSTATE_K_ID) \
|
||||
| (1 << X86_XSTATE_ZMM_H_ID) \
|
||||
| (1 << X86_XSTATE_ZMM_ID) \
|
||||
| (1 << X86_XSTATE_APX_F_ID))
|
||||
|
||||
/* AMX state mask. */
|
||||
# define AMX_STATE_SAVE_MASK \
|
||||
((1 << X86_XSTATE_TILECFG_ID) | (1 << X86_XSTATE_TILEDATA_ID))
|
||||
|
||||
/* States to be included in xsave_state_full_size. */
|
||||
# define FULL_STATE_SAVE_MASK \
|
||||
(STATE_SAVE_MASK | AMX_STATE_SAVE_MASK)
|
||||
#else
|
||||
/* Offset for fxsave/xsave area used by _dl_tlsdesc_dynamic. Since i386
|
||||
uses PUSH to save registers onto stack, use 0 here. */
|
||||
# define STATE_SAVE_OFFSET 0
|
||||
# define TLSDESC_CALL_REGISTER_SAVE_AREA 0
|
||||
|
||||
/* Save SSE, AVX, AXV512, mask and bound registers. */
|
||||
# define STATE_SAVE_MASK \
|
||||
((1 << X86_XSTATE_SSE_ID) \
|
||||
| (1 << X86_XSTATE_AVX_ID) \
|
||||
| (1 << X86_XSTATE_BNDREGS_ID) \
|
||||
| (1 << X86_XSTATE_K_ID) \
|
||||
| (1 << X86_XSTATE_ZMM_H_ID))
|
||||
|
||||
/* States to be included in xsave_state_size. */
|
||||
# define FULL_STATE_SAVE_MASK STATE_SAVE_MASK
|
||||
#endif
|
||||
|
||||
/* States which should be saved for TLSDESC_CALL and TLS_DESC_CALL.
|
||||
Compiler assumes that all registers, including AMX and x87 FPU
|
||||
stack registers, are unchanged after CALL, except for EFLAGS and
|
||||
RAX/EAX. */
|
||||
#define TLSDESC_CALL_STATE_SAVE_MASK \
|
||||
(FULL_STATE_SAVE_MASK | (1 << X86_XSTATE_X87_ID))
|
||||
|
||||
/* Constants for bits in __x86_string_control: */
|
||||
|
||||
|
@ -10,14 +10,14 @@
|
||||
has nanoseconds instead of microseconds. */
|
||||
struct timespec
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
__time64_t tv_sec; /* Seconds. */
|
||||
#else
|
||||
__time_t tv_sec; /* Seconds. */
|
||||
#endif
|
||||
#if __WORDSIZE == 64 \
|
||||
|| (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
|
||||
|| (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
|
||||
|| (__TIMESIZE == 32 && !defined __USE_TIME64_REDIRECTS)
|
||||
__syscall_slong_t tv_nsec; /* Nanoseconds. */
|
||||
#else
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
|
@ -7,7 +7,7 @@
|
||||
microsecond but also has a range of years. */
|
||||
struct timeval
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
__time64_t tv_sec; /* Seconds. */
|
||||
__suseconds64_t tv_usec; /* Microseconds. */
|
||||
#else
|
||||
|
2
lib/libc/glibc/time/bits/types/time_t.h
vendored
2
lib/libc/glibc/time/bits/types/time_t.h
vendored
@ -4,7 +4,7 @@
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Returned by `time'. */
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
typedef __time64_t time_t;
|
||||
#else
|
||||
typedef __time_t time_t;
|
||||
|
@ -73,7 +73,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
20
lib/libc/include/aarch64-linux-gnu/bits/hwcap.h
vendored
20
lib/libc/include/aarch64-linux-gnu/bits/hwcap.h
vendored
@ -99,4 +99,22 @@
|
||||
#define HWCAP2_SME_B16B16 (1UL << 41)
|
||||
#define HWCAP2_SME_F16F16 (1UL << 42)
|
||||
#define HWCAP2_MOPS (1UL << 43)
|
||||
#define HWCAP2_HBC (1UL << 44)
|
||||
#define HWCAP2_HBC (1UL << 44)
|
||||
#define HWCAP2_SVE_B16B16 (1UL << 45)
|
||||
#define HWCAP2_LRCPC3 (1UL << 46)
|
||||
#define HWCAP2_LSE128 (1UL << 47)
|
||||
#define HWCAP2_FPMR (1UL << 48)
|
||||
#define HWCAP2_LUT (1UL << 49)
|
||||
#define HWCAP2_FAMINMAX (1UL << 50)
|
||||
#define HWCAP2_F8CVT (1UL << 51)
|
||||
#define HWCAP2_F8FMA (1UL << 52)
|
||||
#define HWCAP2_F8DP4 (1UL << 53)
|
||||
#define HWCAP2_F8DP2 (1UL << 54)
|
||||
#define HWCAP2_F8E4M3 (1UL << 55)
|
||||
#define HWCAP2_F8E5M2 (1UL << 56)
|
||||
#define HWCAP2_SME_LUTV2 (1UL << 57)
|
||||
#define HWCAP2_SME_F8F16 (1UL << 58)
|
||||
#define HWCAP2_SME_F8F32 (1UL << 59)
|
||||
#define HWCAP2_SME_SF8FMA (1UL << 60)
|
||||
#define HWCAP2_SME_SF8DP4 (1UL << 61)
|
||||
#define HWCAP2_SME_SF8DP2 (1UL << 62)
|
@ -33,22 +33,50 @@
|
||||
# define __DECL_SIMD_acos __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acosf
|
||||
# define __DECL_SIMD_acosf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acosh
|
||||
# define __DECL_SIMD_acosh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acoshf
|
||||
# define __DECL_SIMD_acoshf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asin
|
||||
# define __DECL_SIMD_asin __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinf
|
||||
# define __DECL_SIMD_asinf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinh
|
||||
# define __DECL_SIMD_asinh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinhf
|
||||
# define __DECL_SIMD_asinhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan
|
||||
# define __DECL_SIMD_atan __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanf
|
||||
# define __DECL_SIMD_atanf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanh
|
||||
# define __DECL_SIMD_atanh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanhf
|
||||
# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan2
|
||||
# define __DECL_SIMD_atan2 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan2f
|
||||
# define __DECL_SIMD_atan2f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cbrt
|
||||
# define __DECL_SIMD_cbrt __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cbrtf
|
||||
# define __DECL_SIMD_cbrtf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cos
|
||||
# define __DECL_SIMD_cos __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cosf
|
||||
# define __DECL_SIMD_cosf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cosh
|
||||
# define __DECL_SIMD_cosh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_coshf
|
||||
# define __DECL_SIMD_coshf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erf
|
||||
# define __DECL_SIMD_erf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erff
|
||||
# define __DECL_SIMD_erff __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erfc
|
||||
# define __DECL_SIMD_erfc __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erfcf
|
||||
# define __DECL_SIMD_erfcf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_exp
|
||||
# define __DECL_SIMD_exp __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_expf
|
||||
@ -65,6 +93,10 @@
|
||||
# define __DECL_SIMD_expm1 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_expm1f
|
||||
# define __DECL_SIMD_expm1f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_hypot
|
||||
# define __DECL_SIMD_hypot __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_hypotf
|
||||
# define __DECL_SIMD_hypotf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_log
|
||||
# define __DECL_SIMD_log __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_logf
|
||||
@ -81,14 +113,26 @@
|
||||
# define __DECL_SIMD_log2 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_log2f
|
||||
# define __DECL_SIMD_log2f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_pow
|
||||
# define __DECL_SIMD_pow __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_powf
|
||||
# define __DECL_SIMD_powf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sin
|
||||
# define __DECL_SIMD_sin __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinf
|
||||
# define __DECL_SIMD_sinf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinh
|
||||
# define __DECL_SIMD_sinh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinhf
|
||||
# define __DECL_SIMD_sinhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tan
|
||||
# define __DECL_SIMD_tan __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanf
|
||||
# define __DECL_SIMD_tanf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanh
|
||||
# define __DECL_SIMD_tanh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanhf
|
||||
# define __DECL_SIMD_tanhf __DECL_SIMD_aarch64
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ(9, 0)
|
||||
@ -117,35 +161,57 @@ typedef __SVBool_t __sv_bool_t;
|
||||
|
||||
__vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_erff (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_erfcf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_expf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_exp10f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_exp2f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_expm1f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4vv_hypotf (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_logf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log10f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log1pf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_tanf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t);
|
||||
|
||||
__vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_erf (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_erfc (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp10 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp2 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_expm1 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2vv_hypot (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log10 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log1p (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_tanh (__f64x2_t);
|
||||
|
||||
# undef __ADVSIMD_VEC_MATH_SUPPORTED
|
||||
#endif /* __ADVSIMD_VEC_MATH_SUPPORTED */
|
||||
@ -154,35 +220,57 @@ __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t);
|
||||
|
||||
__sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_erff (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_erfcf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_expf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_exp10f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_exp2f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_expm1f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxvv_hypotf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_logf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log10f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log1pf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_tanf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t);
|
||||
|
||||
__sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_erf (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_erfc (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp10 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp2 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_expm1 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxvv_hypot (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log10 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log1p (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_tan (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_tanh (__sv_f64_t, __sv_bool_t);
|
||||
|
||||
# undef __SVE_VEC_MATH_SUPPORTED
|
||||
#endif /* __SVE_VEC_MATH_SUPPORTED */
|
@ -73,7 +73,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -99,4 +99,22 @@
|
||||
#define HWCAP2_SME_B16B16 (1UL << 41)
|
||||
#define HWCAP2_SME_F16F16 (1UL << 42)
|
||||
#define HWCAP2_MOPS (1UL << 43)
|
||||
#define HWCAP2_HBC (1UL << 44)
|
||||
#define HWCAP2_HBC (1UL << 44)
|
||||
#define HWCAP2_SVE_B16B16 (1UL << 45)
|
||||
#define HWCAP2_LRCPC3 (1UL << 46)
|
||||
#define HWCAP2_LSE128 (1UL << 47)
|
||||
#define HWCAP2_FPMR (1UL << 48)
|
||||
#define HWCAP2_LUT (1UL << 49)
|
||||
#define HWCAP2_FAMINMAX (1UL << 50)
|
||||
#define HWCAP2_F8CVT (1UL << 51)
|
||||
#define HWCAP2_F8FMA (1UL << 52)
|
||||
#define HWCAP2_F8DP4 (1UL << 53)
|
||||
#define HWCAP2_F8DP2 (1UL << 54)
|
||||
#define HWCAP2_F8E4M3 (1UL << 55)
|
||||
#define HWCAP2_F8E5M2 (1UL << 56)
|
||||
#define HWCAP2_SME_LUTV2 (1UL << 57)
|
||||
#define HWCAP2_SME_F8F16 (1UL << 58)
|
||||
#define HWCAP2_SME_F8F32 (1UL << 59)
|
||||
#define HWCAP2_SME_SF8FMA (1UL << 60)
|
||||
#define HWCAP2_SME_SF8DP4 (1UL << 61)
|
||||
#define HWCAP2_SME_SF8DP2 (1UL << 62)
|
@ -33,22 +33,50 @@
|
||||
# define __DECL_SIMD_acos __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acosf
|
||||
# define __DECL_SIMD_acosf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acosh
|
||||
# define __DECL_SIMD_acosh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_acoshf
|
||||
# define __DECL_SIMD_acoshf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asin
|
||||
# define __DECL_SIMD_asin __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinf
|
||||
# define __DECL_SIMD_asinf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinh
|
||||
# define __DECL_SIMD_asinh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_asinhf
|
||||
# define __DECL_SIMD_asinhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan
|
||||
# define __DECL_SIMD_atan __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanf
|
||||
# define __DECL_SIMD_atanf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanh
|
||||
# define __DECL_SIMD_atanh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atanhf
|
||||
# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan2
|
||||
# define __DECL_SIMD_atan2 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_atan2f
|
||||
# define __DECL_SIMD_atan2f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cbrt
|
||||
# define __DECL_SIMD_cbrt __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cbrtf
|
||||
# define __DECL_SIMD_cbrtf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cos
|
||||
# define __DECL_SIMD_cos __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cosf
|
||||
# define __DECL_SIMD_cosf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_cosh
|
||||
# define __DECL_SIMD_cosh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_coshf
|
||||
# define __DECL_SIMD_coshf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erf
|
||||
# define __DECL_SIMD_erf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erff
|
||||
# define __DECL_SIMD_erff __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erfc
|
||||
# define __DECL_SIMD_erfc __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_erfcf
|
||||
# define __DECL_SIMD_erfcf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_exp
|
||||
# define __DECL_SIMD_exp __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_expf
|
||||
@ -65,6 +93,10 @@
|
||||
# define __DECL_SIMD_expm1 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_expm1f
|
||||
# define __DECL_SIMD_expm1f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_hypot
|
||||
# define __DECL_SIMD_hypot __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_hypotf
|
||||
# define __DECL_SIMD_hypotf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_log
|
||||
# define __DECL_SIMD_log __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_logf
|
||||
@ -81,14 +113,26 @@
|
||||
# define __DECL_SIMD_log2 __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_log2f
|
||||
# define __DECL_SIMD_log2f __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_pow
|
||||
# define __DECL_SIMD_pow __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_powf
|
||||
# define __DECL_SIMD_powf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sin
|
||||
# define __DECL_SIMD_sin __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinf
|
||||
# define __DECL_SIMD_sinf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinh
|
||||
# define __DECL_SIMD_sinh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_sinhf
|
||||
# define __DECL_SIMD_sinhf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tan
|
||||
# define __DECL_SIMD_tan __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanf
|
||||
# define __DECL_SIMD_tanf __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanh
|
||||
# define __DECL_SIMD_tanh __DECL_SIMD_aarch64
|
||||
# undef __DECL_SIMD_tanhf
|
||||
# define __DECL_SIMD_tanhf __DECL_SIMD_aarch64
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ(9, 0)
|
||||
@ -117,35 +161,57 @@ typedef __SVBool_t __sv_bool_t;
|
||||
|
||||
__vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_erff (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_erfcf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_expf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_exp10f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_exp2f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_expm1f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4vv_hypotf (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_logf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log10f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log1pf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_tanf (__f32x4_t);
|
||||
__vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t);
|
||||
|
||||
__vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_erf (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_erfc (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp10 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_exp2 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_expm1 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2vv_hypot (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log10 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log1p (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t);
|
||||
__vpcs __f64x2_t _ZGVnN2v_tanh (__f64x2_t);
|
||||
|
||||
# undef __ADVSIMD_VEC_MATH_SUPPORTED
|
||||
#endif /* __ADVSIMD_VEC_MATH_SUPPORTED */
|
||||
@ -154,35 +220,57 @@ __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t);
|
||||
|
||||
__sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_erff (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_erfcf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_expf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_exp10f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_exp2f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_expm1f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxvv_hypotf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_logf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log10f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log1pf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_tanf (__sv_f32_t, __sv_bool_t);
|
||||
__sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t);
|
||||
|
||||
__sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_erf (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_erfc (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp10 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_exp2 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_expm1 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxvv_hypot (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log10 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log1p (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_tan (__sv_f64_t, __sv_bool_t);
|
||||
__sv_f64_t _ZGVsMxv_tanh (__sv_f64_t, __sv_bool_t);
|
||||
|
||||
# undef __SVE_VEC_MATH_SUPPORTED
|
||||
#endif /* __SVE_VEC_MATH_SUPPORTED */
|
15
lib/libc/include/arc-linux-gnu/bits/endianness.h
vendored
Normal file
15
lib/libc/include/arc-linux-gnu/bits/endianness.h
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _BITS_ENDIANNESS_H
|
||||
#define _BITS_ENDIANNESS_H 1
|
||||
|
||||
#ifndef _BITS_ENDIAN_H
|
||||
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
|
||||
#endif
|
||||
|
||||
/* ARC has selectable endianness. */
|
||||
#ifdef __BIG_ENDIAN__
|
||||
# define __BYTE_ORDER __BIG_ENDIAN
|
||||
#else
|
||||
# define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif /* bits/endianness.h */
|
55
lib/libc/include/arc-linux-gnu/bits/fcntl.h
vendored
Normal file
55
lib/libc/include/arc-linux-gnu/bits/fcntl.h
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/* O_*, F_*, FD_* bit values for the generic Linux ABI.
|
||||
Copyright (C) 2011-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
# define __O_LARGEFILE 0
|
||||
#endif
|
||||
|
||||
struct flock
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
__off_t l_start; /* Offset where the lock begins. */
|
||||
__off_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#else
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#endif
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct flock64
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Include generic Linux declarations. */
|
||||
#include <bits/fcntl-linux.h>
|
78
lib/libc/include/arc-linux-gnu/bits/fenv.h
vendored
Normal file
78
lib/libc/include/arc-linux-gnu/bits/fenv.h
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
/* Floating point environment. ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FENV_H
|
||||
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
FE_INVALID =
|
||||
# define FE_INVALID (0x01)
|
||||
FE_INVALID,
|
||||
FE_DIVBYZERO =
|
||||
# define FE_DIVBYZERO (0x02)
|
||||
FE_DIVBYZERO,
|
||||
FE_OVERFLOW =
|
||||
# define FE_OVERFLOW (0x04)
|
||||
FE_OVERFLOW,
|
||||
FE_UNDERFLOW =
|
||||
# define FE_UNDERFLOW (0x08)
|
||||
FE_UNDERFLOW,
|
||||
FE_INEXACT =
|
||||
# define FE_INEXACT (0x10)
|
||||
FE_INEXACT
|
||||
};
|
||||
|
||||
# define FE_ALL_EXCEPT \
|
||||
(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
|
||||
|
||||
enum
|
||||
{
|
||||
FE_TOWARDZERO =
|
||||
# define FE_TOWARDZERO (0x0)
|
||||
FE_TOWARDZERO,
|
||||
FE_TONEAREST =
|
||||
# define FE_TONEAREST (0x1) /* default */
|
||||
FE_TONEAREST,
|
||||
FE_UPWARD =
|
||||
# define FE_UPWARD (0x2)
|
||||
FE_UPWARD,
|
||||
FE_DOWNWARD =
|
||||
# define FE_DOWNWARD (0x3)
|
||||
FE_DOWNWARD
|
||||
};
|
||||
|
||||
typedef unsigned int fexcept_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int __fpcr;
|
||||
unsigned int __fpsr;
|
||||
} fenv_t;
|
||||
|
||||
/* If the default argument is used we use this value. */
|
||||
#define FE_DFL_ENV ((const fenv_t *) -1)
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
/* Default floating-point control modes. */
|
||||
# define FE_DFL_MODE ((const femode_t *) -1L)
|
||||
#endif
|
52
lib/libc/include/arc-linux-gnu/bits/floatn.h
vendored
Normal file
52
lib/libc/include/arc-linux-gnu/bits/floatn.h
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/* Macros to control TS 18661-3 glibc features.
|
||||
Copyright (C) 2017-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Defined to 1 if the current compiler invocation provides a
|
||||
floating-point type with the IEEE 754 binary128 format, and this glibc
|
||||
includes corresponding *f128 interfaces for it. */
|
||||
#define __HAVE_FLOAT128 0
|
||||
|
||||
/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
|
||||
from the default float, double and long double types in this glibc. */
|
||||
#define __HAVE_DISTINCT_FLOAT128 0
|
||||
|
||||
/* Defined to 1 if the current compiler invocation provides a
|
||||
floating-point type with the right format for _Float64x, and this
|
||||
glibc includes corresponding *f64x interfaces for it. */
|
||||
#define __HAVE_FLOAT64X 0
|
||||
|
||||
/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
|
||||
of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
|
||||
the format of _Float128, which must be different from that of long
|
||||
double. */
|
||||
#define __HAVE_FLOAT64X_LONG_DOUBLE 0
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* Defined to concatenate the literal suffix to be used with _Float128
|
||||
types, if __HAVE_FLOAT128 is 1.
|
||||
E.g.: #define __f128(x) x##f128. */
|
||||
# undef __f128
|
||||
|
||||
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.
|
||||
E.g.: #define __CFLOAT128 _Complex _Float128. */
|
||||
# undef __CFLOAT128
|
||||
|
||||
#endif /* !__ASSEMBLER__. */
|
||||
|
||||
#include <bits/floatn-common.h>
|
52
lib/libc/include/arc-linux-gnu/bits/link.h
vendored
Normal file
52
lib/libc/include/arc-linux-gnu/bits/link.h
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/* Machine-specific declarations for dynamic linker interface, ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
# error "Never include <bits/link.h> directly; use <link.h> instead."
|
||||
#endif
|
||||
|
||||
/* Registers for entry into PLT on ARC. */
|
||||
typedef struct La_arc_regs
|
||||
{
|
||||
uint32_t lr_reg[8]; /* r0 through r7 (upto 8 args). */
|
||||
} La_arc_regs;
|
||||
|
||||
/* Return values for calls from PLT on ARC. */
|
||||
typedef struct La_arc_retval
|
||||
{
|
||||
/* For ARCv2, a 64-bit integer return value can use 2 regs. */
|
||||
uint32_t lrv_reg[2];
|
||||
} La_arc_retval;
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
La_arc_regs *__regs,
|
||||
unsigned int *__flags,
|
||||
const char *__symname,
|
||||
long int *__framesizep);
|
||||
extern unsigned int la_arc_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
const La_arc_regs *__inregs,
|
||||
La_arc_retval *__outregs,
|
||||
const char *symname);
|
||||
|
||||
__END_DECLS
|
53
lib/libc/include/arc-linux-gnu/bits/long-double.h
vendored
Normal file
53
lib/libc/include/arc-linux-gnu/bits/long-double.h
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/* Properties of long double type.
|
||||
Copyright (C) 2016-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This header is included by <sys/cdefs.h>.
|
||||
|
||||
If long double is ABI-compatible with double, it should define
|
||||
__NO_LONG_DOUBLE_MATH to 1; otherwise, it should leave
|
||||
__NO_LONG_DOUBLE_MATH undefined.
|
||||
|
||||
If this build of the GNU C Library supports both long double
|
||||
ABI-compatible with double and some other long double format not
|
||||
ABI-compatible with double, it should define
|
||||
__LONG_DOUBLE_MATH_OPTIONAL to 1; otherwise, it should leave
|
||||
__LONG_DOUBLE_MATH_OPTIONAL undefined.
|
||||
|
||||
If __NO_LONG_DOUBLE_MATH is already defined, this header must not
|
||||
define anything; this is needed to work with the definition of
|
||||
__NO_LONG_DOUBLE_MATH in nldbl-compat.h. */
|
||||
|
||||
/* In the default version of this header, long double is
|
||||
ABI-compatible with double. */
|
||||
#ifndef __NO_LONG_DOUBLE_MATH
|
||||
# define __NO_LONG_DOUBLE_MATH 1
|
||||
#endif
|
||||
|
||||
/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the
|
||||
choice of the underlying ABI of long double. It will always assume
|
||||
a constant value for each translation unit.
|
||||
|
||||
If the value is non-zero, any API which is parameterized by the long
|
||||
double type (i.e the scanf/printf family of functions or the explicitly
|
||||
parameterized math.h functions) will be redirected to a compatible
|
||||
implementation using _Float128 ABI via symbols suffixed with ieee128.
|
||||
|
||||
The mechanism this macro uses to acquire may be a function
|
||||
of architecture, or target specific options used to invoke the
|
||||
compiler. */
|
||||
#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
|
35
lib/libc/include/arc-linux-gnu/bits/procfs.h
vendored
Normal file
35
lib/libc/include/arc-linux-gnu/bits/procfs.h
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/* Types for registers for sys/procfs.h. ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
|
||||
#endif
|
||||
|
||||
#include <sys/ucontext.h>
|
||||
|
||||
/* And the whole bunch of them. We could have used `struct
|
||||
user_regs' directly in the typedef, but tradition says that
|
||||
the register set is an array, which does have some peculiar
|
||||
semantics, so leave it that way. */
|
||||
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t))
|
||||
|
||||
typedef unsigned long int elf_greg_t;
|
||||
typedef unsigned long int elf_gregset_t[ELF_NGREG];
|
||||
|
||||
/* There's no separate floating point reg file in ARCv2. */
|
||||
typedef struct { } elf_fpregset_t;
|
26
lib/libc/include/arc-linux-gnu/bits/setjmp.h
vendored
Normal file
26
lib/libc/include/arc-linux-gnu/bits/setjmp.h
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/* Define the machine-dependent type 'jmp_buf'. ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ARC_BITS_SETJMP_H
|
||||
#define _ARC_BITS_SETJMP_H 1
|
||||
|
||||
/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer),
|
||||
blink (branch-n-link). */
|
||||
typedef long int __jmp_buf[32];
|
||||
|
||||
#endif
|
127
lib/libc/include/arc-linux-gnu/bits/struct_stat.h
vendored
Normal file
127
lib/libc/include/arc-linux-gnu/bits/struct_stat.h
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
/* Definition for struct stat.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#if !defined _SYS_STAT_H && !defined _FCNTL_H
|
||||
# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _BITS_STRUCT_STAT_H
|
||||
#define _BITS_STRUCT_STAT_H 1
|
||||
|
||||
#include <bits/endian.h>
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if defined __USE_FILE_OFFSET64
|
||||
# define __field64(type, type64, name) type64 name
|
||||
#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
|
||||
# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
|
||||
# error "ino_t and off_t must both be the same type"
|
||||
# endif
|
||||
# define __field64(type, type64, name) type name
|
||||
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define __field64(type, type64, name) \
|
||||
type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
|
||||
#else
|
||||
# define __field64(type, type64, name) \
|
||||
int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
|
||||
#endif
|
||||
|
||||
struct stat
|
||||
{
|
||||
__dev_t st_dev; /* Device. */
|
||||
__field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
|
||||
__mode_t st_mode; /* File mode. */
|
||||
__nlink_t st_nlink; /* Link count. */
|
||||
__uid_t st_uid; /* User ID of the file's owner. */
|
||||
__gid_t st_gid; /* Group ID of the file's group.*/
|
||||
__dev_t st_rdev; /* Device number, if device. */
|
||||
__dev_t __pad1;
|
||||
__field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
|
||||
__blksize_t st_blksize; /* Optimal block size for I/O. */
|
||||
int __pad2;
|
||||
__field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
|
||||
#ifdef __USE_XOPEN2K8
|
||||
/* Nanosecond resolution timestamps are stored in a format
|
||||
equivalent to 'struct timespec'. This is the type used
|
||||
whenever possible but the Unix namespace rules do not allow the
|
||||
identifier 'timespec' to appear in the <sys/stat.h> header.
|
||||
Therefore we have to handle the use of this header in strictly
|
||||
standard-compliant sources special. */
|
||||
struct timespec st_atim; /* Time of last access. */
|
||||
struct timespec st_mtim; /* Time of last modification. */
|
||||
struct timespec st_ctim; /* Time of last status change. */
|
||||
# define st_atime st_atim.tv_sec /* Backward compatibility. */
|
||||
# define st_mtime st_mtim.tv_sec
|
||||
# define st_ctime st_ctim.tv_sec
|
||||
#else
|
||||
__time_t st_atime; /* Time of last access. */
|
||||
unsigned long int st_atimensec; /* Nscecs of last access. */
|
||||
__time_t st_mtime; /* Time of last modification. */
|
||||
unsigned long int st_mtimensec; /* Nsecs of last modification. */
|
||||
__time_t st_ctime; /* Time of last status change. */
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
#endif
|
||||
int __glibc_reserved[2];
|
||||
};
|
||||
|
||||
#undef __field64
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
__dev_t st_dev; /* Device. */
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
__mode_t st_mode; /* File mode. */
|
||||
__nlink_t st_nlink; /* Link count. */
|
||||
__uid_t st_uid; /* User ID of the file's owner. */
|
||||
__gid_t st_gid; /* Group ID of the file's group.*/
|
||||
__dev_t st_rdev; /* Device number, if device. */
|
||||
__dev_t __pad1;
|
||||
__off64_t st_size; /* Size of file, in bytes. */
|
||||
__blksize_t st_blksize; /* Optimal block size for I/O. */
|
||||
int __pad2;
|
||||
__blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
|
||||
#ifdef __USE_XOPEN2K8
|
||||
/* Nanosecond resolution timestamps are stored in a format
|
||||
equivalent to 'struct timespec'. This is the type used
|
||||
whenever possible but the Unix namespace rules do not allow the
|
||||
identifier 'timespec' to appear in the <sys/stat.h> header.
|
||||
Therefore we have to handle the use of this header in strictly
|
||||
standard-compliant sources special. */
|
||||
struct timespec st_atim; /* Time of last access. */
|
||||
struct timespec st_mtim; /* Time of last modification. */
|
||||
struct timespec st_ctim; /* Time of last status change. */
|
||||
#else
|
||||
__time_t st_atime; /* Time of last access. */
|
||||
unsigned long int st_atimensec; /* Nscecs of last access. */
|
||||
__time_t st_mtime; /* Time of last modification. */
|
||||
unsigned long int st_mtimensec; /* Nsecs of last modification. */
|
||||
__time_t st_ctime; /* Time of last status change. */
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
#endif
|
||||
int __glibc_reserved[2];
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Tell code we have these members. */
|
||||
#define _STATBUF_ST_BLKSIZE
|
||||
#define _STATBUF_ST_RDEV
|
||||
/* Nanosecond resolution time values are supported. */
|
||||
#define _STATBUF_ST_NSEC
|
||||
|
||||
#endif /* _BITS_STRUCT_STAT_H */
|
20
lib/libc/include/arc-linux-gnu/bits/timesize.h
vendored
Normal file
20
lib/libc/include/arc-linux-gnu/bits/timesize.h
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/* Bit size of the time_t type at glibc build time, general case.
|
||||
Copyright (C) 2018-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Size in bits of the 'time_t' type of the default ABI. */
|
||||
#define __TIMESIZE 64
|
12
lib/libc/include/arc-linux-gnu/bits/types/__sigset_t.h
vendored
Normal file
12
lib/libc/include/arc-linux-gnu/bits/types/__sigset_t.h
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/* Architecture-specific __sigset_t definition. ARC version. */
|
||||
#ifndef ____sigset_t_defined
|
||||
#define ____sigset_t_defined
|
||||
|
||||
/* Linux asm-generic syscall ABI expects sigset_t to hold 64 signals. */
|
||||
#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long int)))
|
||||
typedef struct
|
||||
{
|
||||
unsigned long int __val[_SIGSET_NWORDS];
|
||||
} __sigset_t;
|
||||
|
||||
#endif
|
21
lib/libc/include/arc-linux-gnu/bits/wordsize.h
vendored
Normal file
21
lib/libc/include/arc-linux-gnu/bits/wordsize.h
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
105
lib/libc/include/arc-linux-gnu/fpu_control.h
vendored
Normal file
105
lib/libc/include/arc-linux-gnu/fpu_control.h
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/* FPU control word bits. ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FPU_CONTROL_H
|
||||
#define _FPU_CONTROL_H
|
||||
|
||||
/* ARC FPU control register bits.
|
||||
|
||||
[ 0] -> IVE: Enable invalid operation exception.
|
||||
if 0, soft exception: status register IV flag set.
|
||||
if 1, hardware exception trap (not supported in Linux yet).
|
||||
[ 1] -> DZE: Enable division by zero exception.
|
||||
if 0, soft exception: status register IV flag set.
|
||||
if 1, hardware exception: (not supported in Linux yet).
|
||||
[9:8] -> RM: Rounding Mode:
|
||||
00 - Rounding toward zero.
|
||||
01 - Rounding to nearest (default).
|
||||
10 - Rounding (up) toward plus infinity.
|
||||
11 - Rounding (down)toward minus infinity.
|
||||
|
||||
ARC FPU status register bits.
|
||||
|
||||
[ 0] -> IV: flag invalid operation.
|
||||
[ 1] -> DZ: flag division by zero.
|
||||
[ 2] -> OV: flag Overflow operation.
|
||||
[ 3] -> UV: flag Underflow operation.
|
||||
[ 4] -> IX: flag Inexact operation.
|
||||
[31] -> FWE: Flag Write Enable.
|
||||
If 1, above flags writable explicitly (clearing),
|
||||
else IoW and only writable indirectly via bits [12:7]. */
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#if !defined(__ARC_FPU_SP__) && !defined(__ARC_FPU_DP__)
|
||||
|
||||
# define _FPU_RESERVED 0xffffffff
|
||||
# define _FPU_DEFAULT 0x00000000
|
||||
typedef unsigned int fpu_control_t;
|
||||
# define _FPU_GETCW(cw) (cw) = 0
|
||||
# define _FPU_SETCW(cw) (void) (cw)
|
||||
# define _FPU_GETS(cw) (cw) = 0
|
||||
# define _FPU_SETS(cw) (void) (cw)
|
||||
extern fpu_control_t __fpu_control;
|
||||
|
||||
#else
|
||||
|
||||
#define _FPU_RESERVED 0
|
||||
|
||||
/* The fdlibm code requires strict IEEE double precision arithmetic,
|
||||
and no interrupts for exceptions, rounding to nearest.
|
||||
So only RM set to b'01. */
|
||||
# define _FPU_DEFAULT 0x00000100
|
||||
|
||||
/* Actually default needs to have FWE bit as 1 but that is already
|
||||
ingrained into _FPU_SETS macro below. */
|
||||
#define _FPU_FPSR_DEFAULT 0x00000000
|
||||
|
||||
#define __FPU_RND_SHIFT 8
|
||||
#define __FPU_RND_MASK 0x3
|
||||
|
||||
/* Type of the control word. */
|
||||
typedef unsigned int fpu_control_t;
|
||||
|
||||
/* Macros for accessing the hardware control word. */
|
||||
# define _FPU_GETCW(cw) __asm__ volatile ("lr %0, [0x300]" : "=r" (cw))
|
||||
# define _FPU_SETCW(cw) __asm__ volatile ("sr %0, [0x300]" : : "r" (cw))
|
||||
|
||||
/* Macros for accessing the hardware status word.
|
||||
Writing to FPU_STATUS requires a "control" bit FWE to be able to set the
|
||||
exception flags directly (as opposed to side-effects of FP instructions).
|
||||
That is done in the macro here to keeps callers agnostic of this detail.
|
||||
And given FWE is write-only and RAZ, no need to "clear" it in _FPU_GETS
|
||||
macro. */
|
||||
# define _FPU_GETS(cw) \
|
||||
__asm__ volatile ("lr %0, [0x301] \r\n" \
|
||||
: "=r" (cw))
|
||||
|
||||
# define _FPU_SETS(cw) \
|
||||
do { \
|
||||
unsigned int __fwe = 0x80000000 | (cw); \
|
||||
__asm__ volatile ("sr %0, [0x301] \r\n" \
|
||||
: : "r" (__fwe)); \
|
||||
} while (0)
|
||||
|
||||
/* Default control word set at startup. */
|
||||
extern fpu_control_t __fpu_control;
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* fpu_control.h */
|
27
lib/libc/include/arc-linux-gnu/gnu/lib-names-arcle.h
vendored
Normal file
27
lib/libc/include/arc-linux-gnu/gnu/lib-names-arcle.h
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/* This file is automatically generated. */
|
||||
#ifndef __GNU_LIB_NAMES_H
|
||||
# error "Never use <gnu/lib-names-arcle.h> directly; include <gnu/lib-names.h> instead."
|
||||
#endif
|
||||
|
||||
#define LD_LINUX_ARC_SO "ld-linux-arc.so.2"
|
||||
#define LD_SO "ld-linux-arc.so.2"
|
||||
#define LIBANL_SO "libanl.so.1"
|
||||
#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
|
||||
#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
|
||||
#define LIBC_SO "libc.so.6"
|
||||
#define LIBDL_SO "libdl.so.2"
|
||||
#define LIBGCC_S_SO "libgcc_s.so.1"
|
||||
#define LIBMVEC_SO "libmvec.so.1"
|
||||
#define LIBM_SO "libm.so.6"
|
||||
#define LIBNSL_SO "libnsl.so.1"
|
||||
#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
|
||||
#define LIBNSS_DB_SO "libnss_db.so.2"
|
||||
#define LIBNSS_DNS_SO "libnss_dns.so.2"
|
||||
#define LIBNSS_FILES_SO "libnss_files.so.2"
|
||||
#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
|
||||
#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
|
||||
#define LIBPTHREAD_SO "libpthread.so.0"
|
||||
#define LIBRESOLV_SO "libresolv.so.2"
|
||||
#define LIBRT_SO "librt.so.1"
|
||||
#define LIBTHREAD_DB_SO "libthread_db.so.1"
|
||||
#define LIBUTIL_SO "libutil.so.1"
|
16
lib/libc/include/arc-linux-gnu/gnu/lib-names.h
vendored
Normal file
16
lib/libc/include/arc-linux-gnu/gnu/lib-names.h
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/* This file is automatically generated.
|
||||
It defines macros to allow user program to find the shared
|
||||
library files which come as part of GNU libc. */
|
||||
#ifndef __GNU_LIB_NAMES_H
|
||||
#define __GNU_LIB_NAMES_H 1
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if !defined __BIG_ENDIAN__
|
||||
# include <gnu/lib-names-arcle.h>
|
||||
#endif
|
||||
#if defined __BIG_ENDIAN__
|
||||
# include <gnu/lib-names-arcbe.h>
|
||||
#endif
|
||||
|
||||
#endif /* gnu/lib-names.h */
|
38
lib/libc/include/arc-linux-gnu/gnu/stubs-arcle.h
vendored
Normal file
38
lib/libc/include/arc-linux-gnu/gnu/stubs-arcle.h
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/* This file is automatically generated.
|
||||
It defines a symbol `__stub_FUNCTION' for each function
|
||||
in the C library which is a stub, meaning it will fail
|
||||
every time called, usually setting errno to ENOSYS. */
|
||||
|
||||
#ifdef _LIBC
|
||||
#error Applications may not define the macro _LIBC
|
||||
#endif
|
||||
|
||||
#define __stub___compat_bdflush
|
||||
#define __stub___compat_create_module
|
||||
#define __stub___compat_get_kernel_syms
|
||||
#define __stub___compat_query_module
|
||||
#define __stub___compat_uselib
|
||||
#define __stub_chflags
|
||||
#define __stub_fchflags
|
||||
#define __stub_feclearexcept
|
||||
#define __stub_fedisableexcept
|
||||
#define __stub_feenableexcept
|
||||
#define __stub_fegetenv
|
||||
#define __stub_fegetexcept
|
||||
#define __stub_fegetexceptflag
|
||||
#define __stub_fegetmode
|
||||
#define __stub_fegetround
|
||||
#define __stub_feholdexcept
|
||||
#define __stub_feraiseexcept
|
||||
#define __stub_fesetenv
|
||||
#define __stub_fesetexcept
|
||||
#define __stub_fesetexceptflag
|
||||
#define __stub_fesetmode
|
||||
#define __stub_fesetround
|
||||
#define __stub_fetestexcept
|
||||
#define __stub_feupdateenv
|
||||
#define __stub_gtty
|
||||
#define __stub_revoke
|
||||
#define __stub_setlogin
|
||||
#define __stub_sigreturn
|
||||
#define __stub_stty
|
12
lib/libc/include/arc-linux-gnu/gnu/stubs.h
vendored
Normal file
12
lib/libc/include/arc-linux-gnu/gnu/stubs.h
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/* This file is automatically generated.
|
||||
This file selects the right generated file of `__stub_FUNCTION' macros
|
||||
based on the architecture being compiled for. */
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if !defined __BIG_ENDIAN__
|
||||
# include <gnu/stubs-arcle.h>
|
||||
#endif
|
||||
#if defined __BIG_ENDIAN__
|
||||
# include <gnu/stubs-arcbe.h>
|
||||
#endif
|
35
lib/libc/include/arc-linux-gnu/sys/cachectl.h
vendored
Normal file
35
lib/libc/include/arc-linux-gnu/sys/cachectl.h
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/* cacheflush - flush contents of instruction and/or data cache.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_CACHECTL_H
|
||||
#define _SYS_CACHECTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the kernel definition for the op bits. */
|
||||
#include <asm/cachectl.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_MISC
|
||||
extern int cacheflush (void *__addr, int __nbytes, int __op) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
57
lib/libc/include/arc-linux-gnu/sys/ucontext.h
vendored
Normal file
57
lib/libc/include/arc-linux-gnu/sys/ucontext.h
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/* struct ucontext definition, ARC version.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* System V/ARC ABI compliant context switching support. */
|
||||
|
||||
#ifndef _SYS_UCONTEXT_H
|
||||
#define _SYS_UCONTEXT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types/sigset_t.h>
|
||||
#include <bits/types/stack_t.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long int __pad;
|
||||
unsigned long int __bta;
|
||||
unsigned long int __lp_start, __lp_end, __lp_count;
|
||||
unsigned long int __status32, __ret, __blink;
|
||||
unsigned long int __fp, __gp;
|
||||
unsigned long int __r12, __r11, __r10, __r9, __r8, __r7;
|
||||
unsigned long int __r6, __r5, __r4, __r3, __r2, __r1, __r0;
|
||||
unsigned long int __sp;
|
||||
unsigned long int __r26;
|
||||
unsigned long int __r25, __r24, __r23, __r22, __r21, __r20;
|
||||
unsigned long int __r19, __r18, __r17, __r16, __r15, __r14, __r13;
|
||||
unsigned long int __efa;
|
||||
unsigned long int __stop_pc;
|
||||
unsigned long int __r30, __r58, __r59;
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
unsigned long int __uc_flags;
|
||||
struct ucontext_t *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
} ucontext_t;
|
||||
|
||||
#endif
|
32
lib/libc/include/arc-linux-gnu/sys/user.h
vendored
Normal file
32
lib/libc/include/arc-linux-gnu/sys/user.h
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/* ptrace register data format definitions.
|
||||
Copyright (C) 2020-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_USER_H
|
||||
#define _SYS_USER_H 1
|
||||
|
||||
/* Struct user_regs_struct is exported by kernel header
|
||||
However apps like strace also expect a struct user, so it's better to
|
||||
have a dummy implementation. */
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
struct user
|
||||
{
|
||||
long int dummy;
|
||||
};
|
||||
|
||||
#endif
|
@ -81,7 +81,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -83,13 +83,13 @@ struct stat
|
||||
# else
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif
|
||||
#endif /* __USE_TIME_BITS64 */
|
||||
#endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -125,7 +125,7 @@ struct stat64
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
# endif
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
@ -81,7 +81,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -83,13 +83,13 @@ struct stat
|
||||
# else
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif
|
||||
#endif /* __USE_TIME_BITS64 */
|
||||
#endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -125,7 +125,7 @@ struct stat64
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
# endif
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
@ -81,7 +81,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -83,13 +83,13 @@ struct stat
|
||||
# else
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif
|
||||
#endif /* __USE_TIME_BITS64 */
|
||||
#endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -125,7 +125,7 @@ struct stat64
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
# endif
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
@ -81,7 +81,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -83,13 +83,13 @@ struct stat
|
||||
# else
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif
|
||||
#endif /* __USE_TIME_BITS64 */
|
||||
#endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -125,7 +125,7 @@ struct stat64
|
||||
unsigned long int st_ctimensec; /* Nsecs of last status change. */
|
||||
# endif
|
||||
__ino64_t st_ino; /* File serial number. */
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
@ -102,7 +102,7 @@ typedef struct
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -88,7 +88,7 @@ struct stat
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
@ -102,7 +102,7 @@ typedef struct
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
struct stat
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
#else
|
||||
__dev_t st_dev; /* Device. */
|
||||
@ -88,7 +88,7 @@ struct stat
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev; /* Device. */
|
||||
|
@ -16,6 +16,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define __WORDSIZE 32
|
||||
#define __WORDSIZE_TIME64_COMPAT32 0
|
||||
#define __WORDSIZE_TIME64_COMPAT32 1
|
||||
#define __WORDSIZE32_SIZE_ULONG 0
|
||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
4
lib/libc/include/generic-glibc/aio.h
vendored
4
lib/libc/include/generic-glibc/aio.h
vendored
@ -193,7 +193,7 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
|
||||
extern int __REDIRECT_NTH (aio_cancel,
|
||||
(int __fildes, struct aiocb *__aiocbp),
|
||||
aio_cancel64);
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
extern int __REDIRECT_NTH (aio_suspend,
|
||||
(const struct aiocb *const __list[], int __nent,
|
||||
const struct timespec *__restrict __timeout),
|
||||
@ -215,7 +215,7 @@ extern int __REDIRECT_NTH (aio_fsync,
|
||||
# define aio_error aio_error64
|
||||
# define aio_return aio_return64
|
||||
# define aio_cancel aio_cancel64
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# define aio_suspend __aio_suspend_time64
|
||||
# else
|
||||
# define aio_suspend aio_suspend64
|
||||
|
87
lib/libc/include/generic-glibc/bits/fcntl2.h
vendored
87
lib/libc/include/generic-glibc/bits/fcntl2.h
vendored
@ -32,6 +32,8 @@ extern int __REDIRECT (__open_2, (const char *__path, int __oflag),
|
||||
extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...),
|
||||
open64) __nonnull ((1));
|
||||
#endif
|
||||
|
||||
#ifdef __va_arg_pack_len
|
||||
__errordecl (__open_too_many_args,
|
||||
"open can be called either with 2 or 3 arguments, not more");
|
||||
__errordecl (__open_missing_mode,
|
||||
@ -58,12 +60,29 @@ open (const char *__path, int __oflag, ...)
|
||||
|
||||
return __open_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
#elif __fortify_use_clang
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag)
|
||||
__fortify_clang_error (__OPEN_NEEDS_MODE (__oflag),
|
||||
"open with O_CREAT or O_TMPFILE in second argument needs 3 arguments")
|
||||
{
|
||||
return __open_2 (__path, __oflag);
|
||||
}
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag,
|
||||
mode_t __mode)
|
||||
{
|
||||
return __open_alias (__path, __oflag, __mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int __open64_2 (const char *__path, int __oflag) __nonnull ((1));
|
||||
extern int __REDIRECT (__open64_alias, (const char *__path, int __oflag,
|
||||
...), open64) __nonnull ((1));
|
||||
# ifdef __va_arg_pack_len
|
||||
__errordecl (__open64_too_many_args,
|
||||
"open64 can be called either with 2 or 3 arguments, not more");
|
||||
__errordecl (__open64_missing_mode,
|
||||
@ -90,6 +109,27 @@ open64 (const char *__path, int __oflag, ...)
|
||||
|
||||
return __open64_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
open64 (const char *__path, int __oflag, mode_t __mode, ...)
|
||||
__fortify_clang_unavailable ("open64 can be called either with 2 or 3 arguments, not more");
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag)
|
||||
__fortify_clang_prefer_this_overload
|
||||
__fortify_clang_error (__OPEN_NEEDS_MODE (__oflag),
|
||||
"open64 with O_CREAT or O_TMPFILE in second argument needs 3 arguments")
|
||||
{
|
||||
return __open64_2 (__path, __oflag);
|
||||
}
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag,
|
||||
mode_t __mode)
|
||||
{
|
||||
return __open64_alias (__path, __oflag, __mode);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -108,6 +148,8 @@ extern int __REDIRECT (__openat_alias, (int __fd, const char *__path,
|
||||
int __oflag, ...), openat64)
|
||||
__nonnull ((2));
|
||||
# endif
|
||||
|
||||
# ifdef __va_arg_pack_len
|
||||
__errordecl (__openat_too_many_args,
|
||||
"openat can be called either with 3 or 4 arguments, not more");
|
||||
__errordecl (__openat_missing_mode,
|
||||
@ -134,6 +176,28 @@ openat (int __fd, const char *__path, int __oflag, ...)
|
||||
|
||||
return __openat_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
openat (int __fd, const char *__path, int __oflag, mode_t __mode, ...)
|
||||
__fortify_clang_unavailable ("openat can be called either with 3 or 4 arguments, not more");
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
openat (int __fd, __fortify_clang_overload_arg (const char *, ,__path),
|
||||
int __oflag)
|
||||
__fortify_clang_prefer_this_overload
|
||||
__fortify_clang_error (__OPEN_NEEDS_MODE (__oflag),
|
||||
"openat with O_CREAT or O_TMPFILE in third argument needs 4 arguments")
|
||||
{
|
||||
return __openat_2 (__fd, __path, __oflag);
|
||||
}
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
openat (int __fd, __fortify_clang_overload_arg (const char *, ,__path),
|
||||
int __oflag, mode_t __mode)
|
||||
{
|
||||
return __openat_alias (__fd, __path, __oflag, __mode);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
@ -147,6 +211,7 @@ __errordecl (__openat64_too_many_args,
|
||||
__errordecl (__openat64_missing_mode,
|
||||
"openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments");
|
||||
|
||||
# ifdef __va_arg_pack_len
|
||||
__fortify_function int
|
||||
openat64 (int __fd, const char *__path, int __oflag, ...)
|
||||
{
|
||||
@ -168,5 +233,27 @@ openat64 (int __fd, const char *__path, int __oflag, ...)
|
||||
|
||||
return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
openat64 (int __fd, const char *__path, int __oflag, mode_t __mode, ...)
|
||||
__fortify_clang_unavailable ("openat64 can be called either with 3 or 4 arguments, not more");
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
openat64 (int __fd, __fortify_clang_overload_arg (const char *, ,__path),
|
||||
int __oflag)
|
||||
__fortify_clang_prefer_this_overload
|
||||
__fortify_clang_error (__OPEN_NEEDS_MODE (__oflag),
|
||||
"openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments")
|
||||
{
|
||||
return __openat64_2 (__fd, __path, __oflag);
|
||||
}
|
||||
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
openat64 (int __fd, __fortify_clang_overload_arg (const char *, ,__path),
|
||||
int __oflag, mode_t __mode)
|
||||
{
|
||||
return __openat64_alias (__fd, __path, __oflag, __mode);
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
2
lib/libc/include/generic-glibc/bits/fenv.h
vendored
2
lib/libc/include/generic-glibc/bits/fenv.h
vendored
@ -104,7 +104,7 @@ fenv_t;
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef unsigned int femode_t;
|
||||
|
||||
|
2
lib/libc/include/generic-glibc/bits/floatn.h
vendored
2
lib/libc/include/generic-glibc/bits/floatn.h
vendored
@ -1,4 +1,4 @@
|
||||
/* Macros to control TS 18661-3 glibc features on MIPS platforms.
|
||||
/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms.
|
||||
Copyright (C) 2017-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -44,23 +44,23 @@
|
||||
|
||||
/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
macro. Most but not all symbols enabled by that macro in TS
|
||||
18661-1 are enabled unconditionally in C2X. In C2X, the symbols in
|
||||
18661-1 are enabled unconditionally in C23. In C23, the symbols in
|
||||
Annex F still require a new feature test macro
|
||||
__STDC_WANT_IEC_60559_EXT__ instead (C2X does not define
|
||||
__STDC_WANT_IEC_60559_EXT__ instead (C23 does not define
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS
|
||||
18661-1 are not included in C2X (and thus should depend on
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are
|
||||
18661-1 are not included in C23 (and thus should depend on
|
||||
__STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are
|
||||
enabled).
|
||||
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS
|
||||
18661-1 not included in C2X.
|
||||
18661-1 not included in C23.
|
||||
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS
|
||||
18661-1 that are also included in C2X (with no feature test macro
|
||||
required in C2X).
|
||||
__GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS
|
||||
18661-1 that are also included in C23 (with no feature test macro
|
||||
required in C23).
|
||||
|
||||
__GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1
|
||||
that are included in C2X but conditional on
|
||||
that are included in C23 but conditional on
|
||||
__STDC_WANT_IEC_60559_EXT__. (There are currently no features
|
||||
conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS
|
||||
18661-1.) */
|
||||
@ -70,11 +70,11 @@
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1
|
||||
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C23
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23)
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_EXT
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__
|
||||
@ -86,18 +86,18 @@
|
||||
/* ISO/IEC TS 18661-4:2015 defines the
|
||||
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
|
||||
functions, the symbols from this TS are enabled unconditionally in
|
||||
C2X. */
|
||||
C23. */
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT
|
||||
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
|
||||
#endif
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X)
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23)
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0
|
||||
#endif
|
||||
|
||||
/* ISO/IEC TS 18661-3:2015 defines the
|
||||
|
29
lib/libc/include/generic-glibc/bits/mathcalls.h
vendored
29
lib/libc/include/generic-glibc/bits/mathcalls.h
vendored
@ -109,9 +109,24 @@ __MATHCALL_VEC (log10,, (_Mdouble_ __x));
|
||||
/* Break VALUE into integral and fractional parts. */
|
||||
__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)
|
||||
/* Compute exponent to base ten. */
|
||||
__MATHCALL_VEC (exp10,, (_Mdouble_ __x));
|
||||
|
||||
/* Return exp2(X) - 1. */
|
||||
__MATHCALL (exp2m1,, (_Mdouble_ __x));
|
||||
|
||||
/* Return exp10(X) - 1. */
|
||||
__MATHCALL (exp10m1,, (_Mdouble_ __x));
|
||||
|
||||
/* Return log2(1 + X). */
|
||||
__MATHCALL (log2p1,, (_Mdouble_ __x));
|
||||
|
||||
/* Return log10(1 + X). */
|
||||
__MATHCALL (log10p1,, (_Mdouble_ __x));
|
||||
|
||||
/* Return log(1 + X). */
|
||||
__MATHCALL (logp1,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
@ -264,7 +279,7 @@ __MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
__MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y));
|
||||
# endif
|
||||
|
||||
# if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
|
||||
# if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN
|
||||
/* Return X - epsilon. */
|
||||
__MATHCALL (nextdown,, (_Mdouble_ __x));
|
||||
/* Return X + epsilon. */
|
||||
@ -283,7 +298,7 @@ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
|
||||
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN
|
||||
/* Like ilogb, but returning long int. */
|
||||
__MATHDECL (long int, llogb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
@ -328,7 +343,7 @@ __MATHDECL (long long int,llround,, (_Mdouble_ __x));
|
||||
/* Return positive difference between X and Y. */
|
||||
__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC2X)
|
||||
# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC23)
|
||||
/* Return maximum numeric value from X and Y. */
|
||||
__MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
@ -340,7 +355,7 @@ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
|
||||
#endif /* Use ISO C99. */
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN
|
||||
/* Round X to nearest integer value, rounding halfway cases to even. */
|
||||
__MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
@ -372,7 +387,7 @@ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
|
||||
|
||||
#if (__GLIBC_USE (IEC_60559_BFP_EXT) \
|
||||
|| (__MATH_DECLARING_FLOATN \
|
||||
&& (defined __USE_GNU || !__GLIBC_USE (ISOC2X))))
|
||||
&& (defined __USE_GNU || !__GLIBC_USE (ISOC23))))
|
||||
/* Return value with maximum magnitude. */
|
||||
__MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
@ -380,7 +395,7 @@ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
__MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (ISOC2X)
|
||||
#if __GLIBC_USE (ISOC23)
|
||||
/* Return maximum value from X and Y. */
|
||||
__MATHCALLX (fmaximum,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
|
21
lib/libc/include/generic-glibc/bits/mman-linux.h
vendored
21
lib/libc/include/generic-glibc/bits/mman-linux.h
vendored
@ -54,10 +54,29 @@
|
||||
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
|
||||
#endif
|
||||
#define MAP_ANON MAP_ANONYMOUS
|
||||
/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
|
||||
|
||||
/* When MAP_HUGETLB is set, bits [26:31] encode the log2 of the huge page size.
|
||||
The following definitions are associated with this huge page size encoding.
|
||||
It is responsibility of the application to know which sizes are supported on
|
||||
the running system. See mmap(2) man page for details. */
|
||||
|
||||
#define MAP_HUGE_SHIFT 26
|
||||
#define MAP_HUGE_MASK 0x3f
|
||||
|
||||
#define MAP_HUGE_16KB (14 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_64KB (16 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_512KB (19 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_1MB (20 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_8MB (23 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_16MB (24 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_32MB (25 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_256MB (28 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_512MB (29 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_2GB (31 << MAP_HUGE_SHIFT)
|
||||
#define MAP_HUGE_16GB (34U << MAP_HUGE_SHIFT)
|
||||
|
||||
/* Flags to `msync'. */
|
||||
#define MS_ASYNC 1 /* Sync memory asynchronously. */
|
||||
#define MS_SYNC 4 /* Synchronous memory sync. */
|
||||
|
27
lib/libc/include/generic-glibc/bits/mqueue2.h
vendored
27
lib/libc/include/generic-glibc/bits/mqueue2.h
vendored
@ -29,6 +29,8 @@ extern mqd_t __mq_open_2 (const char *__name, int __oflag)
|
||||
extern mqd_t __REDIRECT_NTH (__mq_open_alias, (const char *__name,
|
||||
int __oflag, ...), mq_open)
|
||||
__nonnull ((1));
|
||||
|
||||
#ifdef __va_arg_pack_len
|
||||
__errordecl (__mq_open_wrong_number_of_args,
|
||||
"mq_open can be called either with 2 or 4 arguments");
|
||||
__errordecl (__mq_open_missing_mode_and_attr,
|
||||
@ -54,4 +56,27 @@ __NTH (mq_open (const char *__name, int __oflag, ...))
|
||||
return __mq_open_2 (__name, __oflag);
|
||||
|
||||
return __mq_open_alias (__name, __oflag, __va_arg_pack ());
|
||||
}
|
||||
}
|
||||
#elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ mqd_t
|
||||
__NTH (mq_open (__fortify_clang_overload_arg (const char *, , __name),
|
||||
int __oflag, mode_t __mode, ...))
|
||||
__fortify_clang_unavailable ("mq_open can be called either with 2 or 4 arguments");
|
||||
|
||||
__fortify_function __attribute_overloadable__ mqd_t
|
||||
__NTH (mq_open (__fortify_clang_overload_arg (const char *, ,__name),
|
||||
int __oflag, mode_t __mode, struct mq_attr *__attr))
|
||||
{
|
||||
return __mq_open_alias (__name, __oflag, __mode, __attr);
|
||||
}
|
||||
|
||||
__fortify_function __attribute_overloadable__ mqd_t
|
||||
__NTH (mq_open (__fortify_clang_overload_arg (const char *, ,__name),
|
||||
int __oflag))
|
||||
__fortify_clang_prefer_this_overload
|
||||
__fortify_clang_error ((__oflag & O_CREAT),
|
||||
"mq_open with O_CREAT in second argument needs 4 arguments")
|
||||
{
|
||||
return __mq_open_alias (__name, __oflag);
|
||||
}
|
||||
#endif
|
31
lib/libc/include/generic-glibc/bits/poll2.h
vendored
31
lib/libc/include/generic-glibc/bits/poll2.h
vendored
@ -33,8 +33,13 @@ extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
|
||||
__poll_chk)
|
||||
__warnattr ("poll called with fds buffer too small file nfds entries");
|
||||
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2) int
|
||||
poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2)
|
||||
__attribute_overloadable__ int
|
||||
poll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds,
|
||||
int __timeout)
|
||||
__fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds),
|
||||
"poll called with fds buffer "
|
||||
"too small file nfds entries")
|
||||
{
|
||||
return __glibc_fortify (poll, __nfds, sizeof (*__fds),
|
||||
__glibc_objsize (__fds),
|
||||
@ -43,7 +48,7 @@ poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
extern int __REDIRECT (__ppoll64_alias, (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss), __ppoll64);
|
||||
@ -58,9 +63,13 @@ extern int __REDIRECT (__ppoll64_chk_warn, (struct pollfd *__fds, nfds_t __n,
|
||||
__ppoll64_chk)
|
||||
__warnattr ("ppoll called with fds buffer too small file nfds entries");
|
||||
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2) int
|
||||
ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
|
||||
const __sigset_t *__ss)
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2)
|
||||
__attribute_overloadable__ int
|
||||
ppoll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds,
|
||||
const struct timespec *__timeout, const __sigset_t *__ss)
|
||||
__fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds),
|
||||
"ppoll called with fds buffer "
|
||||
"too small file nfds entries")
|
||||
{
|
||||
return __glibc_fortify (ppoll64, __nfds, sizeof (*__fds),
|
||||
__glibc_objsize (__fds),
|
||||
@ -81,9 +90,13 @@ extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
|
||||
__ppoll_chk)
|
||||
__warnattr ("ppoll called with fds buffer too small file nfds entries");
|
||||
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2) int
|
||||
ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
|
||||
const __sigset_t *__ss)
|
||||
__fortify_function __fortified_attr_access (__write_only__, 1, 2)
|
||||
__attribute_overloadable__ int
|
||||
ppoll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds,
|
||||
const struct timespec *__timeout, const __sigset_t *__ss)
|
||||
__fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds),
|
||||
"ppoll called with fds buffer "
|
||||
"too small file nfds entries")
|
||||
{
|
||||
return __glibc_fortify (ppoll, __nfds, sizeof (*__fds),
|
||||
__glibc_objsize (__fds),
|
||||
|
37
lib/libc/include/generic-glibc/bits/rseq.h
vendored
37
lib/libc/include/generic-glibc/bits/rseq.h
vendored
@ -1,4 +1,4 @@
|
||||
/* Restartable Sequences Linux mips architecture header.
|
||||
/* Restartable Sequences architecture header. Stub version.
|
||||
Copyright (C) 2021-2024 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -26,37 +26,4 @@
|
||||
architecture. When choosing this value, it needs to be taken into
|
||||
account that generating invalid instructions may have ill effects on
|
||||
tools like objdump, and may also have impact on the CPU speculative
|
||||
execution efficiency in some cases.
|
||||
|
||||
RSEQ_SIG uses the break instruction. The instruction pattern is:
|
||||
|
||||
On MIPS:
|
||||
0350000d break 0x350
|
||||
|
||||
On nanoMIPS:
|
||||
00100350 break 0x350
|
||||
|
||||
On microMIPS:
|
||||
0000d407 break 0x350
|
||||
|
||||
For nanoMIPS32 and microMIPS, the instruction stream is encoded as
|
||||
16-bit halfwords, so the signature halfwords need to be swapped
|
||||
accordingly for little-endian. */
|
||||
|
||||
#if defined (__nanomips__)
|
||||
# ifdef __MIPSEL__
|
||||
# define RSEQ_SIG 0x03500010
|
||||
# else
|
||||
# define RSEQ_SIG 0x00100350
|
||||
# endif
|
||||
#elif defined (__mips_micromips)
|
||||
# ifdef __MIPSEL__
|
||||
# define RSEQ_SIG 0xd4070000
|
||||
# else
|
||||
# define RSEQ_SIG 0x0000d407
|
||||
# endif
|
||||
#elif defined (__mips__)
|
||||
# define RSEQ_SIG 0x0350000d
|
||||
#else
|
||||
/* Unknown MIPS architecture. */
|
||||
#endif
|
||||
execution efficiency in some cases. */
|
22
lib/libc/include/generic-glibc/bits/shm.h
vendored
22
lib/libc/include/generic-glibc/bits/shm.h
vendored
@ -58,6 +58,28 @@ typedef __syscall_ulong_t shmatt_t;
|
||||
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
|
||||
# define SHM_NORESERVE 010000 /* don't check for reservations */
|
||||
|
||||
/* When SHM_HUGETLB is set, bits [26:31] encode the log2 of the huge page size.
|
||||
The following definitions are associated with this huge page size encoding.
|
||||
It is responsibility of the application to know which sizes are supported on
|
||||
the running system. See shmget(2) man page for details. */
|
||||
|
||||
#define SHM_HUGE_SHIFT 26
|
||||
#define SHM_HUGE_MASK 0x3f
|
||||
|
||||
#define SHM_HUGE_16KB (14 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_64KB (16 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_512KB (19 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_1MB (20 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_8MB (23 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_16MB (24 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_32MB (25 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_256MB (28 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_512MB (29 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_2GB (31 << SHM_HUGE_SHIFT)
|
||||
#define SHM_HUGE_16GB (34U << SHM_HUGE_SHIFT)
|
||||
|
||||
struct shminfo
|
||||
{
|
||||
__syscall_ulong_t shmmax;
|
||||
|
@ -64,7 +64,7 @@
|
||||
# define SO_TIMESTAMPNS_NEW 64
|
||||
# define SO_TIMESTAMPING_NEW 65
|
||||
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# define SO_RCVTIMEO SO_RCVTIMEO_NEW
|
||||
# define SO_SNDTIMEO SO_SNDTIMEO_NEW
|
||||
# define SO_TIMESTAMP SO_TIMESTAMP_NEW
|
||||
|
5
lib/libc/include/generic-glibc/bits/socket.h
vendored
5
lib/libc/include/generic-glibc/bits/socket.h
vendored
@ -172,6 +172,7 @@ typedef __socklen_t socklen_t;
|
||||
#define SOL_MPTCP 284
|
||||
#define SOL_MCTP 285
|
||||
#define SOL_SMC 286
|
||||
#define SOL_VSOCK 287
|
||||
|
||||
/* Maximum queue length specifiable by listen. */
|
||||
#define SOMAXCONN 4096
|
||||
@ -180,7 +181,7 @@ typedef __socklen_t socklen_t;
|
||||
#include <bits/sockaddr.h>
|
||||
|
||||
/* Structure describing a generic socket address. */
|
||||
struct sockaddr
|
||||
struct __attribute_struct_may_alias__ sockaddr
|
||||
{
|
||||
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
|
||||
char sa_data[14]; /* Address data. */
|
||||
@ -193,7 +194,7 @@ struct sockaddr
|
||||
#define _SS_PADSIZE \
|
||||
(_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
|
||||
|
||||
struct sockaddr_storage
|
||||
struct __attribute_struct_may_alias__ sockaddr_storage
|
||||
{
|
||||
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
|
||||
char __ss_padding[_SS_PADSIZE];
|
||||
|
20
lib/libc/include/generic-glibc/bits/socket2.h
vendored
20
lib/libc/include/generic-glibc/bits/socket2.h
vendored
@ -30,14 +30,20 @@ extern ssize_t __REDIRECT (__recv_chk_warn,
|
||||
__warnattr ("recv called with bigger length than size of destination "
|
||||
"buffer");
|
||||
|
||||
__fortify_function ssize_t
|
||||
recv (int __fd, void *__buf, size_t __n, int __flags)
|
||||
__fortify_function __attribute_overloadable__ ssize_t
|
||||
recv (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __n,
|
||||
int __flags)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__n, __buf,
|
||||
"recv called with bigger length than "
|
||||
"size of destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize0 (__buf);
|
||||
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
|
||||
return __recv_alias (__fd, __buf, __n, __flags);
|
||||
#if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, sizeof (char), sz))
|
||||
return __recv_chk_warn (__fd, __buf, __n, sz, __flags);
|
||||
#endif
|
||||
return __recv_chk (__fd, __buf, __n, sz, __flags);
|
||||
}
|
||||
|
||||
@ -57,15 +63,21 @@ extern ssize_t __REDIRECT (__recvfrom_chk_warn,
|
||||
__warnattr ("recvfrom called with bigger length than size of "
|
||||
"destination buffer");
|
||||
|
||||
__fortify_function ssize_t
|
||||
recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
|
||||
__fortify_function __attribute_overloadable__ ssize_t
|
||||
recvfrom (int __fd, __fortify_clang_overload_arg0 (void *, __restrict, __buf),
|
||||
size_t __n, int __flags,
|
||||
__SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__n, __buf,
|
||||
"recvfrom called with bigger length "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize0 (__buf);
|
||||
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
|
||||
return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
|
||||
#if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, sizeof (char), sz))
|
||||
return __recvfrom_chk_warn (__fd, __buf, __n, sz, __flags, __addr,
|
||||
__addr_len);
|
||||
#endif
|
||||
return __recvfrom_chk (__fd, __buf, __n, sz, __flags, __addr, __addr_len);
|
||||
}
|
@ -42,6 +42,7 @@
|
||||
# define STATX_BTIME 0x0800U
|
||||
# define STATX_MNT_ID 0x1000U
|
||||
# define STATX_DIOALIGN 0x2000U
|
||||
# define STATX_MNT_ID_UNIQUE 0x4000U
|
||||
# define STATX__RESERVED 0x80000000U
|
||||
|
||||
# define STATX_ATTR_COMPRESSED 0x0004
|
||||
|
@ -28,7 +28,7 @@ __LDBL_REDIR_DECL (vprintf)
|
||||
__LDBL_REDIR_DECL (vsprintf)
|
||||
#if !__GLIBC_USE (DEPRECATED_SCANF)
|
||||
# if defined __LDBL_COMPAT
|
||||
# if __GLIBC_USE (C2X_STRTOL)
|
||||
# if __GLIBC_USE (C23_STRTOL)
|
||||
__LDBL_REDIR1_DECL (fscanf, __nldbl___isoc23_fscanf)
|
||||
__LDBL_REDIR1_DECL (scanf, __nldbl___isoc23_scanf)
|
||||
__LDBL_REDIR1_DECL (sscanf, __nldbl___isoc23_sscanf)
|
||||
@ -38,7 +38,7 @@ __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf)
|
||||
__LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf)
|
||||
# endif
|
||||
# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
|
||||
# if __GLIBC_USE (C2X_STRTOL)
|
||||
# if __GLIBC_USE (C23_STRTOL)
|
||||
__LDBL_REDIR1_DECL (fscanf, __isoc23_fscanfieee128)
|
||||
__LDBL_REDIR1_DECL (scanf, __isoc23_scanfieee128)
|
||||
__LDBL_REDIR1_DECL (sscanf, __isoc23_sscanfieee128)
|
||||
@ -64,7 +64,7 @@ __LDBL_REDIR_DECL (vsnprintf)
|
||||
#ifdef __USE_ISOC99
|
||||
# if !__GLIBC_USE (DEPRECATED_SCANF)
|
||||
# if defined __LDBL_COMPAT
|
||||
# if __GLIBC_USE (C2X_STRTOL)
|
||||
# if __GLIBC_USE (C23_STRTOL)
|
||||
__LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc23_vfscanf)
|
||||
__LDBL_REDIR1_DECL (vscanf, __nldbl___isoc23_vscanf)
|
||||
__LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc23_vsscanf)
|
||||
@ -74,7 +74,7 @@ __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf)
|
||||
__LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf)
|
||||
# endif
|
||||
# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
|
||||
# if __GLIBC_USE (C2X_STRTOL)
|
||||
# if __GLIBC_USE (C23_STRTOL)
|
||||
__LDBL_REDIR1_DECL (vfscanf, __isoc23_vfscanfieee128)
|
||||
__LDBL_REDIR1_DECL (vscanf, __isoc23_vscanfieee128)
|
||||
__LDBL_REDIR1_DECL (vsscanf, __isoc23_vsscanfieee128)
|
||||
|
173
lib/libc/include/generic-glibc/bits/stdio2.h
vendored
173
lib/libc/include/generic-glibc/bits/stdio2.h
vendored
@ -31,15 +31,29 @@ __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...))
|
||||
__glibc_objsize (__s), __fmt,
|
||||
__va_arg_pack ());
|
||||
}
|
||||
#elif __fortify_use_clang
|
||||
/* clang does not have __va_arg_pack, so defer to va_arg version. */
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
__NTH (sprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
|
||||
const char *__restrict __fmt, ...))
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
|
||||
__glibc_objsize (__s), __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
#elif !defined __cplusplus
|
||||
# define sprintf(str, ...) \
|
||||
__builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, \
|
||||
__glibc_objsize (str), __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
__fortify_function int
|
||||
__NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt,
|
||||
__gnuc_va_list __ap))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (vsprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
|
||||
const char *__restrict __fmt, __gnuc_va_list __ap))
|
||||
{
|
||||
return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
|
||||
__glibc_objsize (__s), __fmt, __ap);
|
||||
@ -55,15 +69,33 @@ __NTH (snprintf (char *__restrict __s, size_t __n,
|
||||
__glibc_objsize (__s), __fmt,
|
||||
__va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
/* clang does not have __va_arg_pack, so defer to va_arg version. */
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
__NTH (snprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
|
||||
size_t __n, const char *__restrict __fmt, ...))
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
|
||||
__glibc_objsize (__s), __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
# elif !defined __cplusplus
|
||||
# define snprintf(str, len, ...) \
|
||||
__builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, \
|
||||
__glibc_objsize (str), __VA_ARGS__)
|
||||
# endif
|
||||
|
||||
__fortify_function int
|
||||
__NTH (vsnprintf (char *__restrict __s, size_t __n,
|
||||
const char *__restrict __fmt, __gnuc_va_list __ap))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (vsnprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
|
||||
size_t __n, const char *__restrict __fmt,
|
||||
__gnuc_va_list __ap))
|
||||
__fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s),
|
||||
"call to vsnprintf may overflow the destination "
|
||||
"buffer")
|
||||
{
|
||||
return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
|
||||
__glibc_objsize (__s), __fmt, __ap);
|
||||
@ -85,6 +117,30 @@ printf (const char *__restrict __fmt, ...)
|
||||
{
|
||||
return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
/* clang does not have __va_arg_pack, so defer to va_arg version. */
|
||||
__fortify_function_error_function __attribute_overloadable__ __nonnull ((1)) int
|
||||
fprintf (__fortify_clang_overload_arg (FILE *, __restrict, __stream),
|
||||
const char *__restrict __fmt, ...)
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __builtin___vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1,
|
||||
__fmt, __fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
printf (__fortify_clang_overload_arg (const char *, __restrict, __fmt), ...)
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __builtin___vprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
# elif !defined __cplusplus
|
||||
# define printf(...) \
|
||||
__printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
|
||||
@ -92,8 +148,9 @@ printf (const char *__restrict __fmt, ...)
|
||||
__fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
|
||||
# endif
|
||||
|
||||
__fortify_function int
|
||||
vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
vprintf (__fortify_clang_overload_arg (const char *, __restrict, __fmt),
|
||||
__gnuc_va_list __ap)
|
||||
{
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
|
||||
@ -117,6 +174,18 @@ dprintf (int __fd, const char *__restrict __fmt, ...)
|
||||
return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
dprintf (int __fd, __fortify_clang_overload_arg (const char *, __restrict,
|
||||
__fmt), ...)
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
# elif !defined __cplusplus
|
||||
# define dprintf(fd, ...) \
|
||||
__dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
|
||||
@ -153,6 +222,43 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack,
|
||||
return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__va_arg_pack ());
|
||||
}
|
||||
# elif __fortify_use_clang
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
__NTH (asprintf (__fortify_clang_overload_arg (char **, __restrict, __ptr),
|
||||
const char *__restrict __fmt, ...))
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
__NTH (__asprintf (__fortify_clang_overload_arg (char **, __restrict, __ptr),
|
||||
const char *__restrict __fmt, ...))
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
|
||||
__fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
|
||||
__fortify_function_error_function __attribute_overloadable__ int
|
||||
__NTH (obstack_printf (__fortify_clang_overload_arg (struct obstack *,
|
||||
__restrict, __obstack),
|
||||
const char *__restrict __fmt, ...))
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
int __r = __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1,
|
||||
__fmt, __fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
return __r;
|
||||
}
|
||||
# elif !defined __cplusplus
|
||||
# define asprintf(ptr, ...) \
|
||||
__asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
|
||||
@ -182,8 +288,11 @@ __NTH (obstack_vprintf (struct obstack *__restrict __obstack,
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (DEPRECATED_GETS)
|
||||
__fortify_function __wur char *
|
||||
gets (char *__str)
|
||||
__fortify_function __wur __attribute_overloadable__ char *
|
||||
gets (__fortify_clang_overload_arg (char *, , __str))
|
||||
__fortify_clang_warning (__glibc_objsize (__str) == (size_t) -1,
|
||||
"please use fgets or getline instead, gets "
|
||||
"can not specify buffer size")
|
||||
{
|
||||
if (__glibc_objsize (__str) != (size_t) -1)
|
||||
return __gets_chk (__str, __glibc_objsize (__str));
|
||||
@ -192,48 +301,70 @@ gets (char *__str)
|
||||
#endif
|
||||
|
||||
__fortify_function __wur __fortified_attr_access (__write_only__, 1, 2)
|
||||
__nonnull ((3)) char *
|
||||
fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
|
||||
__nonnull ((3)) __attribute_overloadable__ char *
|
||||
fgets (__fortify_clang_overload_arg (char *, __restrict, __s), int __n,
|
||||
FILE *__restrict __stream)
|
||||
__fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s) && __n > 0,
|
||||
"fgets called with bigger size than length of "
|
||||
"destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize (__s);
|
||||
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
|
||||
return __fgets_alias (__s, __n, __stream);
|
||||
#if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, sizeof (char), sz))
|
||||
return __fgets_chk_warn (__s, sz, __n, __stream);
|
||||
#endif
|
||||
return __fgets_chk (__s, sz, __n, __stream);
|
||||
}
|
||||
|
||||
__fortify_function __wur __nonnull ((4)) size_t
|
||||
fread (void *__restrict __ptr, size_t __size, size_t __n,
|
||||
FILE *__restrict __stream)
|
||||
__fortify_function __wur __nonnull ((4)) __attribute_overloadable__ size_t
|
||||
fread (__fortify_clang_overload_arg (void *, __restrict, __ptr),
|
||||
size_t __size, size_t __n, FILE *__restrict __stream)
|
||||
__fortify_clang_warning (__fortify_clang_bos0_static_lt (__size * __n, __ptr)
|
||||
&& !__fortify_clang_mul_may_overflow (__size, __n),
|
||||
"fread called with bigger size * n than length "
|
||||
"of destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize0 (__ptr);
|
||||
if (__glibc_safe_or_unknown_len (__n, __size, sz))
|
||||
return __fread_alias (__ptr, __size, __n, __stream);
|
||||
#if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, __size, sz))
|
||||
return __fread_chk_warn (__ptr, sz, __size, __n, __stream);
|
||||
#endif
|
||||
return __fread_chk (__ptr, sz, __size, __n, __stream);
|
||||
}
|
||||
|
||||
#ifdef __USE_GNU
|
||||
__fortify_function __wur __fortified_attr_access (__write_only__, 1, 2)
|
||||
__nonnull ((3)) char *
|
||||
fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
|
||||
__nonnull ((3)) __attribute_overloadable__ char *
|
||||
fgets_unlocked (__fortify_clang_overload_arg (char *, __restrict, __s),
|
||||
int __n, FILE *__restrict __stream)
|
||||
__fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s) && __n > 0,
|
||||
"fgets called with bigger size than length of "
|
||||
"destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize (__s);
|
||||
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
|
||||
return __fgets_unlocked_alias (__s, __n, __stream);
|
||||
#if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, sizeof (char), sz))
|
||||
return __fgets_unlocked_chk_warn (__s, sz, __n, __stream);
|
||||
#endif
|
||||
return __fgets_unlocked_chk (__s, sz, __n, __stream);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# undef fread_unlocked
|
||||
__fortify_function __wur __nonnull ((4)) size_t
|
||||
fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
|
||||
FILE *__restrict __stream)
|
||||
__fortify_function __wur __nonnull ((4)) __attribute_overloadable__ size_t
|
||||
fread_unlocked (__fortify_clang_overload_arg0 (void *, __restrict, __ptr),
|
||||
size_t __size, size_t __n, FILE *__restrict __stream)
|
||||
__fortify_clang_warning (__fortify_clang_bos0_static_lt (__size * __n, __ptr)
|
||||
&& !__fortify_clang_mul_may_overflow (__size, __n),
|
||||
"fread_unlocked called with bigger size * n than "
|
||||
"length of destination buffer")
|
||||
{
|
||||
size_t sz = __glibc_objsize0 (__ptr);
|
||||
if (__glibc_safe_or_unknown_len (__n, __size, sz))
|
||||
@ -261,8 +392,10 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
|
||||
# endif
|
||||
return __fread_unlocked_alias (__ptr, __size, __n, __stream);
|
||||
}
|
||||
# if !__fortify_use_clang
|
||||
if (__glibc_unsafe_len (__n, __size, sz))
|
||||
return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream);
|
||||
# endif
|
||||
return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream);
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ __LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
|
||||
# ifdef __LDBL_COMPAT
|
||||
__LDBL_REDIR1_DECL (strfroml, strfromd)
|
||||
# else
|
||||
|
39
lib/libc/include/generic-glibc/bits/stdlib.h
vendored
39
lib/libc/include/generic-glibc/bits/stdlib.h
vendored
@ -33,15 +33,22 @@ extern char *__REDIRECT_NTH (__realpath_chk_warn,
|
||||
__warnattr ("second argument of realpath must be either NULL or at "
|
||||
"least PATH_MAX bytes long buffer");
|
||||
|
||||
__fortify_function __wur char *
|
||||
__NTH (realpath (const char *__restrict __name, char *__restrict __resolved))
|
||||
__fortify_function __attribute_overloadable__ __wur char *
|
||||
__NTH (realpath (const char *__restrict __name,
|
||||
__fortify_clang_overload_arg (char *, __restrict, __resolved)))
|
||||
#if defined _LIBC_LIMITS_H_ && defined PATH_MAX
|
||||
__fortify_clang_warning_only_if_bos_lt (PATH_MAX, __resolved,
|
||||
"second argument of realpath must be "
|
||||
"either NULL or at least PATH_MAX "
|
||||
"bytes long buffer")
|
||||
#endif
|
||||
{
|
||||
size_t sz = __glibc_objsize (__resolved);
|
||||
|
||||
if (sz == (size_t) -1)
|
||||
return __realpath_alias (__name, __resolved);
|
||||
|
||||
#if defined _LIBC_LIMITS_H_ && defined PATH_MAX
|
||||
#if !__fortify_use_clang && defined _LIBC_LIMITS_H_ && defined PATH_MAX
|
||||
if (__glibc_unsafe_len (PATH_MAX, sizeof (char), sz))
|
||||
return __realpath_chk_warn (__name, __resolved, sz);
|
||||
#endif
|
||||
@ -61,8 +68,13 @@ extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
|
||||
__nonnull ((2)) __warnattr ("ptsname_r called with buflen bigger than "
|
||||
"size of buf");
|
||||
|
||||
__fortify_function int
|
||||
__NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (ptsname_r (int __fd,
|
||||
__fortify_clang_overload_arg (char *, ,__buf),
|
||||
size_t __buflen))
|
||||
__fortify_clang_warning_only_if_bos_lt (__buflen, __buf,
|
||||
"ptsname_r called with buflen "
|
||||
"bigger than size of buf")
|
||||
{
|
||||
return __glibc_fortify (ptsname_r, __buflen, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -75,8 +87,8 @@ extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
|
||||
extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar),
|
||||
wctomb) __wur;
|
||||
|
||||
__fortify_function __wur int
|
||||
__NTH (wctomb (char *__s, wchar_t __wchar))
|
||||
__fortify_function __attribute_overloadable__ __wur int
|
||||
__NTH (wctomb (__fortify_clang_overload_arg (char *, ,__s), wchar_t __wchar))
|
||||
{
|
||||
/* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
|
||||
But this would only disturb the namespace. So we define our own
|
||||
@ -113,9 +125,13 @@ extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
|
||||
__warnattr ("mbstowcs called with dst buffer smaller than len "
|
||||
"* sizeof (wchar_t)");
|
||||
|
||||
__fortify_function size_t
|
||||
__NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src,
|
||||
__fortify_function __attribute_overloadable__ size_t
|
||||
__NTH (mbstowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst),
|
||||
const char *__restrict __src,
|
||||
size_t __len))
|
||||
__fortify_clang_warning_only_if_bos0_lt2 (__len, __dst, sizeof (wchar_t),
|
||||
"mbstowcs called with dst buffer "
|
||||
"smaller than len * sizeof (wchar_t)")
|
||||
{
|
||||
if (__builtin_constant_p (__dst == NULL) && __dst == NULL)
|
||||
return __mbstowcs_nulldst (__dst, __src, __len);
|
||||
@ -139,8 +155,9 @@ extern size_t __REDIRECT_NTH (__wcstombs_chk_warn,
|
||||
size_t __len, size_t __dstlen), __wcstombs_chk)
|
||||
__warnattr ("wcstombs called with dst buffer smaller than len");
|
||||
|
||||
__fortify_function size_t
|
||||
__NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src,
|
||||
__fortify_function __attribute_overloadable__ size_t
|
||||
__NTH (wcstombs (__fortify_clang_overload_arg (char *, __restrict, __dst),
|
||||
const wchar_t *__restrict __src,
|
||||
size_t __len))
|
||||
{
|
||||
return __glibc_fortify (wcstombs, __len, sizeof (char),
|
||||
|
@ -73,24 +73,29 @@ __NTH (explicit_bzero (void *__dest, size_t __len))
|
||||
}
|
||||
#endif
|
||||
|
||||
__fortify_function char *
|
||||
__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (strcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src))
|
||||
__fortify_clang_warn_if_src_too_large (__dest, __src)
|
||||
{
|
||||
return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest));
|
||||
}
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
__fortify_function char *
|
||||
__NTH (stpcpy (char *__restrict __dest, const char *__restrict __src))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (stpcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src))
|
||||
__fortify_clang_warn_if_src_too_large (__dest, __src)
|
||||
{
|
||||
return __builtin___stpcpy_chk (__dest, __src, __glibc_objsize (__dest));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
__fortify_function char *
|
||||
__NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
|
||||
size_t __len))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (strncpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src, size_t __len))
|
||||
__fortify_clang_warn_if_dest_too_small (__dest, __len)
|
||||
{
|
||||
return __builtin___strncpy_chk (__dest, __src, __len,
|
||||
__glibc_objsize (__dest));
|
||||
@ -98,8 +103,10 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
# if __GNUC_PREREQ (4, 7) || __glibc_clang_prereq (2, 6)
|
||||
__fortify_function char *
|
||||
__NTH (stpncpy (char *__dest, const char *__src, size_t __n))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest),
|
||||
const char *__src, size_t __n))
|
||||
__fortify_clang_warn_if_dest_too_small (__dest, __n)
|
||||
{
|
||||
return __builtin___stpncpy_chk (__dest, __src, __n,
|
||||
__glibc_objsize (__dest));
|
||||
@ -112,8 +119,9 @@ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
|
||||
extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
|
||||
size_t __n), stpncpy);
|
||||
|
||||
__fortify_function char *
|
||||
__NTH (stpncpy (char *__dest, const char *__src, size_t __n))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest),
|
||||
const char *__src, size_t __n))
|
||||
{
|
||||
if (__bos (__dest) != (size_t) -1
|
||||
&& (!__builtin_constant_p (__n) || __n > __bos (__dest)))
|
||||
@ -124,16 +132,19 @@ __NTH (stpncpy (char *__dest, const char *__src, size_t __n))
|
||||
#endif
|
||||
|
||||
|
||||
__fortify_function char *
|
||||
__NTH (strcat (char *__restrict __dest, const char *__restrict __src))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (strcat (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src))
|
||||
__fortify_clang_warn_if_src_too_large (__dest, __src)
|
||||
{
|
||||
return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest));
|
||||
}
|
||||
|
||||
|
||||
__fortify_function char *
|
||||
__NTH (strncat (char *__restrict __dest, const char *__restrict __src,
|
||||
size_t __len))
|
||||
__fortify_function __attribute_overloadable__ char *
|
||||
__NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src, size_t __len))
|
||||
__fortify_clang_warn_if_src_too_large (__dest, __src)
|
||||
{
|
||||
return __builtin___strncat_chk (__dest, __src, __len,
|
||||
__glibc_objsize (__dest));
|
||||
@ -146,9 +157,10 @@ extern size_t __REDIRECT_NTH (__strlcpy_alias,
|
||||
(char *__dest, const char *__src, size_t __n),
|
||||
strlcpy);
|
||||
|
||||
__fortify_function size_t
|
||||
__NTH (strlcpy (char *__restrict __dest, const char *__restrict __src,
|
||||
size_t __n))
|
||||
__fortify_function __attribute_overloadable__ size_t
|
||||
__NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src, size_t __n))
|
||||
__fortify_clang_warn_if_dest_too_small (__dest, __n)
|
||||
{
|
||||
if (__glibc_objsize (__dest) != (size_t) -1
|
||||
&& (!__builtin_constant_p (__n > __glibc_objsize (__dest))
|
||||
@ -163,9 +175,9 @@ extern size_t __REDIRECT_NTH (__strlcat_alias,
|
||||
(char *__dest, const char *__src, size_t __n),
|
||||
strlcat);
|
||||
|
||||
__fortify_function size_t
|
||||
__NTH (strlcat (char *__restrict __dest, const char *__restrict __src,
|
||||
size_t __n))
|
||||
__fortify_function __attribute_overloadable__ size_t
|
||||
__NTH (strlcat (__fortify_clang_overload_arg (char *, __restrict, __dest),
|
||||
const char *__restrict __src, size_t __n))
|
||||
{
|
||||
if (__glibc_objsize (__dest) != (size_t) -1
|
||||
&& (!__builtin_constant_p (__n > __glibc_objsize (__dest))
|
||||
|
@ -29,7 +29,7 @@
|
||||
/* Structure describing file characteristics. */
|
||||
struct stat
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
unsigned long int st_dev;
|
||||
@ -82,13 +82,13 @@ struct stat
|
||||
__blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
|
||||
# endif
|
||||
long int st_pad5[14];
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
unsigned long int st_dev;
|
||||
@ -123,7 +123,7 @@ struct stat64
|
||||
long int st_pad3;
|
||||
__blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
|
||||
long int st_pad4[14];
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
# endif /* __USE_LARGEFILE64 */
|
||||
|
||||
@ -131,7 +131,7 @@ struct stat64
|
||||
|
||||
struct stat
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev;
|
||||
@ -189,7 +189,7 @@ struct stat
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct stat64
|
||||
{
|
||||
# ifdef __USE_TIME_BITS64
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/struct_stat_time64_helper.h>
|
||||
# else
|
||||
__dev_t st_dev;
|
||||
@ -224,7 +224,7 @@ struct stat64
|
||||
unsigned int st_pad3;
|
||||
__blkcnt64_t st_blocks;
|
||||
int st_pad4[14];
|
||||
# endif /* __USE_TIME_BITS64 */
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
24
lib/libc/include/generic-glibc/bits/syscall.h
vendored
24
lib/libc/include/generic-glibc/bits/syscall.h
vendored
@ -1,11 +1,11 @@
|
||||
/* Generated at libc build time from syscall list. */
|
||||
/* The system call list corresponds to kernel 6.7. */
|
||||
/* The system call list corresponds to kernel 6.9. */
|
||||
|
||||
#ifndef _SYSCALL_H
|
||||
# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
|
||||
#endif
|
||||
|
||||
#define __GLIBC_LINUX_VERSION_CODE 395008
|
||||
#define __GLIBC_LINUX_VERSION_CODE 395520
|
||||
|
||||
#ifdef __NR_FAST_atomic_update
|
||||
# define SYS_FAST_atomic_update __NR_FAST_atomic_update
|
||||
@ -867,6 +867,10 @@
|
||||
# define SYS_listen __NR_listen
|
||||
#endif
|
||||
|
||||
#ifdef __NR_listmount
|
||||
# define SYS_listmount __NR_listmount
|
||||
#endif
|
||||
|
||||
#ifdef __NR_listxattr
|
||||
# define SYS_listxattr __NR_listxattr
|
||||
#endif
|
||||
@ -899,6 +903,18 @@
|
||||
# define SYS_lsetxattr __NR_lsetxattr
|
||||
#endif
|
||||
|
||||
#ifdef __NR_lsm_get_self_attr
|
||||
# define SYS_lsm_get_self_attr __NR_lsm_get_self_attr
|
||||
#endif
|
||||
|
||||
#ifdef __NR_lsm_list_modules
|
||||
# define SYS_lsm_list_modules __NR_lsm_list_modules
|
||||
#endif
|
||||
|
||||
#ifdef __NR_lsm_set_self_attr
|
||||
# define SYS_lsm_set_self_attr __NR_lsm_set_self_attr
|
||||
#endif
|
||||
|
||||
#ifdef __NR_lstat
|
||||
# define SYS_lstat __NR_lstat
|
||||
#endif
|
||||
@ -2283,6 +2299,10 @@
|
||||
# define SYS_statfs64 __NR_statfs64
|
||||
#endif
|
||||
|
||||
#ifdef __NR_statmount
|
||||
# define SYS_statmount __NR_statmount
|
||||
#endif
|
||||
|
||||
#ifdef __NR_statx
|
||||
# define SYS_statx __NR_statx
|
||||
#endif
|
||||
|
14
lib/libc/include/generic-glibc/bits/syslog.h
vendored
14
lib/libc/include/generic-glibc/bits/syslog.h
vendored
@ -36,6 +36,15 @@ syslog (int __pri, const char *__fmt, ...)
|
||||
{
|
||||
__syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
|
||||
}
|
||||
#elif __fortify_use_clang && defined __USE_MISC
|
||||
__fortify_function_error_function __attribute_overloadable__ void
|
||||
syslog (int __pri, __fortify_clang_overload_arg (const char *, , __fmt), ...)
|
||||
{
|
||||
__gnuc_va_list __fortify_ap;
|
||||
__builtin_va_start (__fortify_ap, __fmt);
|
||||
__vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __fortify_ap);
|
||||
__builtin_va_end (__fortify_ap);
|
||||
}
|
||||
#elif !defined __cplusplus
|
||||
# define syslog(pri, ...) \
|
||||
__syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
|
||||
@ -43,8 +52,9 @@ syslog (int __pri, const char *__fmt, ...)
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
__fortify_function void
|
||||
vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
|
||||
__fortify_function __attribute_overloadable__ void
|
||||
vsyslog (int __pri, __fortify_clang_overload_arg (const char *, ,__fmt),
|
||||
__gnuc_va_list __ap)
|
||||
{
|
||||
__vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
|
||||
}
|
||||
|
2
lib/libc/include/generic-glibc/bits/time.h
vendored
2
lib/libc/include/generic-glibc/bits/time.h
vendored
@ -77,7 +77,7 @@ __BEGIN_DECLS
|
||||
/* Tune a POSIX clock. */
|
||||
extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW __nonnull((2));
|
||||
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# if defined(__REDIRECT_NTH)
|
||||
extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
|
||||
struct timex *__utx),
|
||||
|
2
lib/libc/include/generic-glibc/bits/timex.h
vendored
2
lib/libc/include/generic-glibc/bits/timex.h
vendored
@ -25,7 +25,7 @@
|
||||
|
||||
struct timex
|
||||
{
|
||||
# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32)
|
||||
# if defined __USE_TIME64_REDIRECTS || (__TIMESIZE == 64 && __WORDSIZE == 32)
|
||||
unsigned int modes; /* mode selector */
|
||||
int :32; /* pad */
|
||||
long long offset; /* time offset (usec) */
|
||||
|
@ -92,10 +92,10 @@ struct _IO_FILE_complete
|
||||
struct _IO_wide_data *_wide_data;
|
||||
struct _IO_FILE *_freeres_list;
|
||||
void *_freeres_buf;
|
||||
size_t __pad5;
|
||||
struct _IO_FILE **_prevchain;
|
||||
int _mode;
|
||||
/* Make sure we don't get into trouble again. */
|
||||
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
|
||||
char _unused2[15 * sizeof (int) - 5 * sizeof (void *)];
|
||||
};
|
||||
|
||||
/* These macros are used by bits/stdio.h and internal headers. */
|
||||
|
@ -26,7 +26,7 @@
|
||||
The type `struct msg' is opaque. */
|
||||
struct msqid_ds
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/types/struct_msqid64_ds_helper.h>
|
||||
#else
|
||||
struct ipc_perm msg_perm; /* structure describing operation permission */
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* Data structure describing a set of semaphores. */
|
||||
struct semid_ds
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/types/struct_semid64_ds_helper.h>
|
||||
#else
|
||||
struct ipc_perm sem_perm; /* operation permission struct */
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* Data structure describing a shared memory segment. */
|
||||
struct shmid_ds
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# include <bits/types/struct_shmid64_ds_helper.h>
|
||||
#else
|
||||
struct ipc_perm shm_perm; /* operation permission struct */
|
||||
|
@ -10,14 +10,14 @@
|
||||
has nanoseconds instead of microseconds. */
|
||||
struct timespec
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
__time64_t tv_sec; /* Seconds. */
|
||||
#else
|
||||
__time_t tv_sec; /* Seconds. */
|
||||
#endif
|
||||
#if __WORDSIZE == 64 \
|
||||
|| (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
|
||||
|| (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
|
||||
|| (__TIMESIZE == 32 && !defined __USE_TIME64_REDIRECTS)
|
||||
__syscall_slong_t tv_nsec; /* Nanoseconds. */
|
||||
#else
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
|
@ -7,7 +7,7 @@
|
||||
microsecond but also has a range of years. */
|
||||
struct timeval
|
||||
{
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
__time64_t tv_sec; /* Seconds. */
|
||||
__suseconds64_t tv_usec; /* Microseconds. */
|
||||
#else
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Returned by `time'. */
|
||||
#ifdef __USE_TIME_BITS64
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
typedef __time64_t time_t;
|
||||
#else
|
||||
typedef __time_t time_t;
|
||||
|
46
lib/libc/include/generic-glibc/bits/typesizes.h
vendored
46
lib/libc/include/generic-glibc/bits/typesizes.h
vendored
@ -1,5 +1,5 @@
|
||||
/* bits/typesizes.h -- underlying types for *_t. MIPS version.
|
||||
Copyright (C) 2002-2024 Free Software Foundation, Inc.
|
||||
/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
|
||||
Copyright (C) 2011-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -13,7 +13,7 @@
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
License along with the GNU C Library. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_TYPES_H
|
||||
@ -25,44 +25,57 @@
|
||||
|
||||
/* See <bits/types.h> for the meaning of these macros. This file exists so
|
||||
that <bits/types.h> need not vary across different GNU platforms. */
|
||||
#if __TIMESIZE == 64 && __WORDSIZE == 32
|
||||
/* These are the "new" y2038 types defined for architectures added after
|
||||
the 5.1 kernel. */
|
||||
# define __INO_T_TYPE __UQUAD_TYPE
|
||||
# define __OFF_T_TYPE __SQUAD_TYPE
|
||||
# define __RLIM_T_TYPE __UQUAD_TYPE
|
||||
# define __BLKCNT_T_TYPE __SQUAD_TYPE
|
||||
# define __FSBLKCNT_T_TYPE __UQUAD_TYPE
|
||||
# define __FSFILCNT_T_TYPE __UQUAD_TYPE
|
||||
# define __TIME_T_TYPE __SQUAD_TYPE
|
||||
# define __SUSECONDS_T_TYPE __SQUAD_TYPE
|
||||
#else
|
||||
# define __INO_T_TYPE __ULONGWORD_TYPE
|
||||
# define __OFF_T_TYPE __SLONGWORD_TYPE
|
||||
# define __RLIM_T_TYPE __ULONGWORD_TYPE
|
||||
# define __BLKCNT_T_TYPE __SLONGWORD_TYPE
|
||||
# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
|
||||
# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
|
||||
# define __TIME_T_TYPE __SLONGWORD_TYPE
|
||||
# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
|
||||
#endif
|
||||
|
||||
#define __DEV_T_TYPE __UQUAD_TYPE
|
||||
#define __UID_T_TYPE __U32_TYPE
|
||||
#define __GID_T_TYPE __U32_TYPE
|
||||
#define __INO_T_TYPE __ULONGWORD_TYPE
|
||||
#define __INO64_T_TYPE __UQUAD_TYPE
|
||||
#define __MODE_T_TYPE __U32_TYPE
|
||||
#define __NLINK_T_TYPE __UWORD_TYPE
|
||||
#define __OFF_T_TYPE __SLONGWORD_TYPE
|
||||
#define __NLINK_T_TYPE __U32_TYPE
|
||||
#define __OFF64_T_TYPE __SQUAD_TYPE
|
||||
#define __PID_T_TYPE __S32_TYPE
|
||||
#define __RLIM_T_TYPE __ULONGWORD_TYPE
|
||||
#define __RLIM64_T_TYPE __UQUAD_TYPE
|
||||
#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
|
||||
#define __BLKCNT64_T_TYPE __SQUAD_TYPE
|
||||
#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
|
||||
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
|
||||
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
|
||||
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
|
||||
#define __FSWORD_T_TYPE __SWORD_TYPE
|
||||
#define __ID_T_TYPE __U32_TYPE
|
||||
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
|
||||
#define __TIME_T_TYPE __SLONGWORD_TYPE
|
||||
#define __USECONDS_T_TYPE __U32_TYPE
|
||||
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
|
||||
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
|
||||
#define __DADDR_T_TYPE __S32_TYPE
|
||||
#define __KEY_T_TYPE __S32_TYPE
|
||||
#define __CLOCKID_T_TYPE __S32_TYPE
|
||||
#define __TIMER_T_TYPE void *
|
||||
#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
|
||||
#define __BLKSIZE_T_TYPE __S32_TYPE
|
||||
#define __FSID_T_TYPE struct { int __val[2]; }
|
||||
#define __SSIZE_T_TYPE __SWORD_TYPE
|
||||
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
|
||||
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
|
||||
#define __CPU_MASK_TYPE __ULONGWORD_TYPE
|
||||
|
||||
#ifdef __LP64__
|
||||
#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32)
|
||||
/* Tell the libc code that off_t and off64_t are actually the same type
|
||||
for all ABI purposes, even if possibly expressed as different base types
|
||||
for C type-checking purposes. */
|
||||
@ -71,20 +84,19 @@
|
||||
/* Same for ino_t and ino64_t. */
|
||||
# define __INO_T_MATCHES_INO64_T 1
|
||||
|
||||
/* And for rlim_t and rlim64_t. */
|
||||
/* And for __rlim_t and __rlim64_t. */
|
||||
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||
|
||||
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
|
||||
# define __STATFS_MATCHES_STATFS64 1
|
||||
|
||||
/* And for getitimer, setitimer and rusage */
|
||||
# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
|
||||
# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
|
||||
#else
|
||||
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||
|
||||
# define __STATFS_MATCHES_STATFS64 0
|
||||
|
||||
/* And for getitimer, setitimer and rusage */
|
||||
# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
|
||||
#endif
|
||||
|
||||
|
@ -47,6 +47,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
|
||||
#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */
|
||||
#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */
|
||||
#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */
|
||||
#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
110
lib/libc/include/generic-glibc/bits/unistd.h
vendored
110
lib/libc/include/generic-glibc/bits/unistd.h
vendored
@ -22,8 +22,12 @@
|
||||
|
||||
# include <bits/unistd-decl.h>
|
||||
|
||||
__fortify_function __wur ssize_t
|
||||
read (int __fd, void *__buf, size_t __nbytes)
|
||||
__fortify_function __attribute_overloadable__ __wur ssize_t
|
||||
read (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __nbytes)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf,
|
||||
"read called with bigger length than "
|
||||
"size of the destination buffer")
|
||||
|
||||
{
|
||||
return __glibc_fortify (read, __nbytes, sizeof (char),
|
||||
__glibc_objsize0 (__buf),
|
||||
@ -32,16 +36,24 @@ read (int __fd, void *__buf, size_t __nbytes)
|
||||
|
||||
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
__fortify_function __wur ssize_t
|
||||
pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
|
||||
__fortify_function __attribute_overloadable__ __wur ssize_t
|
||||
pread (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf),
|
||||
size_t __nbytes, __off_t __offset)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf,
|
||||
"pread called with bigger length than "
|
||||
"size of the destination buffer")
|
||||
{
|
||||
return __glibc_fortify (pread, __nbytes, sizeof (char),
|
||||
__glibc_objsize0 (__buf),
|
||||
__fd, __buf, __nbytes, __offset);
|
||||
}
|
||||
# else
|
||||
__fortify_function __wur ssize_t
|
||||
pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
|
||||
__fortify_function __attribute_overloadable__ __wur ssize_t
|
||||
pread (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf),
|
||||
size_t __nbytes, __off64_t __offset)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf,
|
||||
"pread called with bigger length than "
|
||||
"size of the destination buffer")
|
||||
{
|
||||
return __glibc_fortify (pread64, __nbytes, sizeof (char),
|
||||
__glibc_objsize0 (__buf),
|
||||
@ -50,8 +62,12 @@ pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
__fortify_function __wur ssize_t
|
||||
pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
|
||||
__fortify_function __attribute_overloadable__ __wur ssize_t
|
||||
pread64 (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf),
|
||||
size_t __nbytes, __off64_t __offset)
|
||||
__fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf,
|
||||
"pread64 called with bigger length than "
|
||||
"size of the destination buffer")
|
||||
{
|
||||
return __glibc_fortify (pread64, __nbytes, sizeof (char),
|
||||
__glibc_objsize0 (__buf),
|
||||
@ -61,9 +77,14 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
|
||||
__fortify_function __nonnull ((1, 2)) __wur ssize_t
|
||||
__NTH (readlink (const char *__restrict __path, char *__restrict __buf,
|
||||
__fortify_function __attribute_overloadable__ __nonnull ((1, 2)) __wur ssize_t
|
||||
__NTH (readlink (const char *__restrict __path,
|
||||
__fortify_clang_overload_arg0 (char *, __restrict, __buf),
|
||||
size_t __len))
|
||||
__fortify_clang_warning_only_if_bos_lt (__len, __buf,
|
||||
"readlink called with bigger length "
|
||||
"than size of destination buffer")
|
||||
|
||||
{
|
||||
return __glibc_fortify (readlink, __len, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -72,9 +93,13 @@ __NTH (readlink (const char *__restrict __path, char *__restrict __buf,
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
__fortify_function __nonnull ((2, 3)) __wur ssize_t
|
||||
__fortify_function __attribute_overloadable__ __nonnull ((2, 3)) __wur ssize_t
|
||||
__NTH (readlinkat (int __fd, const char *__restrict __path,
|
||||
char *__restrict __buf, size_t __len))
|
||||
__fortify_clang_overload_arg0 (char *, __restrict, __buf),
|
||||
size_t __len))
|
||||
__fortify_clang_warning_only_if_bos_lt (__len, __buf,
|
||||
"readlinkat called with bigger length "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (readlinkat, __len, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -82,8 +107,11 @@ __NTH (readlinkat (int __fd, const char *__restrict __path,
|
||||
}
|
||||
#endif
|
||||
|
||||
__fortify_function __wur char *
|
||||
__NTH (getcwd (char *__buf, size_t __size))
|
||||
__fortify_function __attribute_overloadable__ __wur char *
|
||||
__NTH (getcwd (__fortify_clang_overload_arg (char *, , __buf), size_t __size))
|
||||
__fortify_clang_warning_only_if_bos_lt (__size, __buf,
|
||||
"getcwd called with bigger length "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (getcwd, __size, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -91,8 +119,9 @@ __NTH (getcwd (char *__buf, size_t __size))
|
||||
}
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
|
||||
__fortify_function __nonnull ((1)) __attribute_deprecated__ __wur char *
|
||||
__NTH (getwd (char *__buf))
|
||||
__fortify_function __attribute_overloadable__ __nonnull ((1))
|
||||
__attribute_deprecated__ __wur char *
|
||||
__NTH (getwd (__fortify_clang_overload_arg (char *,, __buf)))
|
||||
{
|
||||
if (__glibc_objsize (__buf) != (size_t) -1)
|
||||
return __getwd_chk (__buf, __glibc_objsize (__buf));
|
||||
@ -100,8 +129,12 @@ __NTH (getwd (char *__buf))
|
||||
}
|
||||
#endif
|
||||
|
||||
__fortify_function size_t
|
||||
__NTH (confstr (int __name, char *__buf, size_t __len))
|
||||
__fortify_function __attribute_overloadable__ size_t
|
||||
__NTH (confstr (int __name, __fortify_clang_overload_arg (char *, ,__buf),
|
||||
size_t __len))
|
||||
__fortify_clang_warning_only_if_bos_lt (__len, __buf,
|
||||
"confstr called with bigger length than "
|
||||
"size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (confstr, __len, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -109,8 +142,13 @@ __NTH (confstr (int __name, char *__buf, size_t __len))
|
||||
}
|
||||
|
||||
|
||||
__fortify_function int
|
||||
__NTH (getgroups (int __size, __gid_t __list[]))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (getgroups (int __size,
|
||||
__fortify_clang_overload_arg (__gid_t *, , __list)))
|
||||
__fortify_clang_warning_only_if_bos_lt (__size * sizeof (__gid_t), __list,
|
||||
"getgroups called with bigger group "
|
||||
"count than what can fit into "
|
||||
"destination buffer")
|
||||
{
|
||||
return __glibc_fortify (getgroups, __size, sizeof (__gid_t),
|
||||
__glibc_objsize (__list),
|
||||
@ -118,8 +156,13 @@ __NTH (getgroups (int __size, __gid_t __list[]))
|
||||
}
|
||||
|
||||
|
||||
__fortify_function int
|
||||
__NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (ttyname_r (int __fd,
|
||||
__fortify_clang_overload_arg (char *, ,__buf),
|
||||
size_t __buflen))
|
||||
__fortify_clang_warning_only_if_bos_lt (__buflen, __buf,
|
||||
"ttyname_r called with bigger buflen "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (ttyname_r, __buflen, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -128,8 +171,11 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
|
||||
|
||||
|
||||
#ifdef __USE_POSIX199506
|
||||
__fortify_function int
|
||||
getlogin_r (char *__buf, size_t __buflen)
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
getlogin_r (__fortify_clang_overload_arg (char *, ,__buf), size_t __buflen)
|
||||
__fortify_clang_warning_only_if_bos_lt (__buflen, __buf,
|
||||
"getlogin_r called with bigger buflen "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (getlogin_r, __buflen, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -139,8 +185,12 @@ getlogin_r (char *__buf, size_t __buflen)
|
||||
|
||||
|
||||
#if defined __USE_MISC || defined __USE_UNIX98
|
||||
__fortify_function int
|
||||
__NTH (gethostname (char *__buf, size_t __buflen))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (gethostname (__fortify_clang_overload_arg (char *, ,__buf),
|
||||
size_t __buflen))
|
||||
__fortify_clang_warning_only_if_bos_lt (__buflen, __buf,
|
||||
"gethostname called with bigger buflen "
|
||||
"than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (gethostname, __buflen, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
@ -150,8 +200,12 @@ __NTH (gethostname (char *__buf, size_t __buflen))
|
||||
|
||||
|
||||
#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)
|
||||
__fortify_function int
|
||||
__NTH (getdomainname (char *__buf, size_t __buflen))
|
||||
__fortify_function __attribute_overloadable__ int
|
||||
__NTH (getdomainname (__fortify_clang_overload_arg (char *, ,__buf),
|
||||
size_t __buflen))
|
||||
__fortify_clang_warning_only_if_bos_lt (__buflen, __buf,
|
||||
"getdomainname called with bigger "
|
||||
"buflen than size of destination buffer")
|
||||
{
|
||||
return __glibc_fortify (getdomainname, __buflen, sizeof (char),
|
||||
__glibc_objsize (__buf),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user