summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/argp.h29
-rw-r--r--include/arpa/nameser.h1
-rw-r--r--include/assert.h5
-rw-r--r--include/ctype.h32
-rw-r--r--include/elf.h165
-rw-r--r--include/fcntl.h44
-rw-r--r--include/features.h24
-rw-r--r--include/internal/time64_helpers.h31
-rw-r--r--include/libc-symbols.h14
-rw-r--r--include/net/ppp_defs.h2
-rw-r--r--include/resolv.h10
-rw-r--r--include/setjmp.h22
-rw-r--r--include/stdlib.h4
-rw-r--r--include/string.h4
-rw-r--r--include/sys/auxv.h34
-rw-r--r--include/sys/cdefs.h11
-rw-r--r--include/sys/personality.h18
-rw-r--r--include/sys/resource.h23
-rw-r--r--include/sys/socket.h2
-rw-r--r--include/sys/stat.h18
-rw-r--r--include/unistd.h4
21 files changed, 402 insertions, 95 deletions
diff --git a/include/argp.h b/include/argp.h
index 8e8674296..d67723521 100644
--- a/include/argp.h
+++ b/include/argp.h
@@ -46,12 +46,14 @@
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
+# define __UCLIBC_ATTRIBUTE_FALLBACK__
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
# define __format__ format
# define __printf__ printf
+# define __UCLIBC_PRINTF_FALLBACK__
# endif
#endif
@@ -71,7 +73,7 @@
typedef int error_t;
# define __error_t_defined
#endif
-
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -145,7 +147,7 @@ struct argp_option
distinguish these two cases, -x should probably be marked
OPTION_NO_USAGE. */
#define OPTION_NO_USAGE 0x10
-
+
struct argp; /* fwd declare this type */
struct argp_state; /* " */
struct argp_child; /* " */
@@ -283,7 +285,7 @@ struct argp
suppressed. */
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
-
+
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
argp_child structures, each of which describes a subsidiary argp. */
struct argp_child
@@ -308,7 +310,7 @@ struct argp_child
(merging the child's grouping levels with the parents). */
int group;
};
-
+
/* Parsing state. This is provided to parsing functions called by argp,
which may examine and, as noted, modify fields. */
struct argp_state
@@ -356,7 +358,7 @@ struct argp_state
void *pstate; /* Private, for use by argp. */
};
-
+
/* Flags for argp_parse (note that the defaults are those that are
convenient for program command line parsing): */
@@ -412,7 +414,7 @@ extern error_t argp_parse (__const struct argp *__restrict __argp,
int __argc, char **__restrict __argv,
unsigned __flags, int *__restrict __arg_index,
void *__restrict __input);
-
+
/* Global variables. */
/* If defined or set by the user program to a non-zero value, then a default
@@ -441,7 +443,7 @@ extern __const char *argp_program_bug_address;
If not defined or set by the user program, this defaults to EX_USAGE from
<sysexits.h>. */
extern error_t argp_err_exit_status;
-
+
/* Flags for argp_help. */
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
@@ -476,7 +478,7 @@ extern error_t argp_err_exit_status;
extern void argp_help (__const struct argp *__restrict __argp,
FILE *__restrict __stream,
unsigned __flags, char *__restrict __name);
-
+
/* The following routines are intended to be called from within an argp
parsing routine (thus taking an argp_state structure as the first
argument). They may or may not print an error message and exit, depending
@@ -526,7 +528,7 @@ extern int __option_is_end (__const struct argp_option *__opt) __THROW;
extern void *__argp_input (__const struct argp *__restrict __argp,
__const struct argp_state *__restrict __state)
__THROW;
-
+
#ifdef __USE_EXTERN_INLINES
# ifndef ARGP_EI
@@ -562,4 +564,13 @@ __NTH (__option_is_end (__const struct argp_option *__opt))
}
#endif
+#ifdef __UCLIBC_ATTRIBUTE_FALLBACK__
+# undef __attribute__
+#endif
+
+#ifdef __UCLIBC_PRINTF_FALLBACK__
+# undef __format__
+# undef __printf__
+#endif
+
#endif /* argp.h */
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index 17c68f595..315305b1c 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -283,6 +283,7 @@ typedef enum __ns_type {
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
+ ns_t_tkey = 249, /* Transaction key */
ns_t_tsig = 250, /* Transaction signature. */
ns_t_ixfr = 251, /* Incremental zone transfer. */
ns_t_axfr = 252, /* Transfer zone of authority. */
diff --git a/include/assert.h b/include/assert.h
index ee8e85fa2..fd71e833b 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -76,3 +76,8 @@ __END_DECLS
# endif
#endif /* NDEBUG. */
+
+#if defined __USE_ISOC11 && !defined __cplusplus
+# undef static_assert
+# define static_assert _Static_assert
+#endif
diff --git a/include/ctype.h b/include/ctype.h
index ecd5e7308..05f21c553 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -350,46 +350,14 @@ libc_hidden_proto(tolower_l)
/* Return the uppercase version of C. */
extern int toupper_l (int __c, __locale_t __l) __THROW;
-# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
-# define tolower_l(c, locale) __tobody(c, tolower_l, (locale)->__ctype_tolower, (c, locale))
-# define toupper_l(c, locale) __tobody(c, toupper_l, (locale)->__ctype_toupper, (c, locale))
-# endif /* Optimizing gcc */
-
-
# define __isctype_l(c, type, locale) ((locale)->__ctype_b[(int) (c)] & (__ctype_mask_t) type)
# ifndef __NO_CTYPE
-# define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l))
-# define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l))
-# define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l))
-# define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l))
-# define __islower_l(c,l) __isctype_l((c), _ISlower, (l))
-# define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l))
-# define __isprint_l(c,l) __isctype_l((c), _ISprint, (l))
-# define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l))
-# define __isspace_l(c,l) __isctype_l((c), _ISspace, (l))
-# define __isupper_l(c,l) __isctype_l((c), _ISupper, (l))
-# define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
-# define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
-
# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
&& defined __UCLIBC_SUSV4_LEGACY__
# define __isascii_l(c,l) ((l), __isascii (c))
# define __toascii_l(c,l) ((l), __toascii (c))
# endif
-# define isalnum_l(c,l) __isalnum_l ((c), (l))
-# define isalpha_l(c,l) __isalpha_l ((c), (l))
-# define iscntrl_l(c,l) __iscntrl_l ((c), (l))
-# define isdigit_l(c,l) __isdigit_l ((c), (l))
-# define islower_l(c,l) __islower_l ((c), (l))
-# define isgraph_l(c,l) __isgraph_l ((c), (l))
-# define isprint_l(c,l) __isprint_l ((c), (l))
-# define ispunct_l(c,l) __ispunct_l ((c), (l))
-# define isspace_l(c,l) __isspace_l ((c), (l))
-# define isupper_l(c,l) __isupper_l ((c), (l))
-# define isxdigit_l(c,l) __isxdigit_l ((c), (l))
-# define isblank_l(c,l) __isblank_l ((c), (l))
-
# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
&& defined __UCLIBC_SUSV4_LEGACY__
# define isascii_l(c,l) __isascii_l ((c), (l))
diff --git a/include/elf.h b/include/elf.h
index 9aae04cef..c2efa9978 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -60,6 +60,9 @@ typedef uint16_t Elf64_Section;
typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;
+/* Type for relative relocations in DT_RELR format */
+typedef Elf32_Word Elf32_Relr;
+typedef Elf64_Xword Elf64_Relr;
/* The ELF file header. This appears at the start of every ELF file. */
@@ -270,11 +273,14 @@ typedef struct
#define EM_METAG 174 /* Imagination Technologies Meta */
#define EM_AARCH64 183 /* ARM AARCH64 */
#define EM_MICROBLAZE 189 /* Xilinx Microblaze */
-#define EM_ARCV2 195 /* ARCv2 Cores */
+#define EM_ARCV2 195 /* Synopsys ARCv2 Cores */
+#define EM_RISCV 243 /* RISC-V */
#define EM_CSKY 252 /* C-SKY Cores */
+#define EM_ARCV3_32 255 /* Synopsys ARCv3 32-bit Cores */
+#define EM_KVX 256 /* Kalray VLIW core of the MPPA processor family */
/* NEXT FREE NUMBER: Increment this after adding your official arch number */
-#define EM_NUM 253
+#define EM_NUM 257
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
@@ -815,7 +821,10 @@ typedef struct
#define DT_ENCODING 32 /* Start of encoded range */
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
-#define DT_NUM 34 /* Number used */
+#define DT_RELRSZ 35 /* Size in bytes, of DT_RELR table */
+#define DT_RELR 36 /* Address of Relr relocs */
+#define DT_RELRENT 37 /* Size in bytes of one DT_RELR entry */
+#define DT_NUM 38 /* Number used */
#define DT_LOOS 0x6000000d /* Start of OS-specific */
#define DT_HIOS 0x6ffff000 /* End of OS-specific */
#define DT_LOPROC 0x70000000 /* Start of processor-specific */
@@ -1252,6 +1261,90 @@ typedef struct
#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
+/* KVX relocs */
+#define R_KVX_NONE 0
+#define R_KVX_16 1
+#define R_KVX_32 2
+#define R_KVX_64 3
+#define R_KVX_S16_PCREL 4
+#define R_KVX_PCREL17 5
+#define R_KVX_PCREL27 6
+#define R_KVX_32_PCREL 7
+#define R_KVX_S37_PCREL_LO10 8
+#define R_KVX_S37_PCREL_UP27 9
+#define R_KVX_S43_PCREL_LO10 10
+#define R_KVX_S43_PCREL_UP27 11
+#define R_KVX_S43_PCREL_EX6 12
+#define R_KVX_S64_PCREL_LO10 13
+#define R_KVX_S64_PCREL_UP27 14
+#define R_KVX_S64_PCREL_EX27 15
+#define R_KVX_64_PCREL 16
+#define R_KVX_S16 17
+#define R_KVX_S32_LO5 18
+#define R_KVX_S32_UP27 19
+#define R_KVX_S37_LO10 20
+#define R_KVX_S37_UP27 21
+#define R_KVX_S37_GOTOFF_LO10 22
+#define R_KVX_S37_GOTOFF_UP27 23
+#define R_KVX_S43_GOTOFF_LO10 24
+#define R_KVX_S43_GOTOFF_UP27 25
+#define R_KVX_S43_GOTOFF_EX6 26
+#define R_KVX_32_GOTOFF 27
+#define R_KVX_64_GOTOFF 28
+#define R_KVX_32_GOT 29
+#define R_KVX_S37_GOT_LO10 30
+#define R_KVX_S37_GOT_UP27 31
+#define R_KVX_S43_GOT_LO10 32
+#define R_KVX_S43_GOT_UP27 33
+#define R_KVX_S43_GOT_EX6 34
+#define R_KVX_64_GOT 35
+#define R_KVX_GLOB_DAT 36
+#define R_KVX_COPY 37
+#define R_KVX_JMP_SLOT 38
+#define R_KVX_RELATIVE 39
+#define R_KVX_S43_LO10 40
+#define R_KVX_S43_UP27 41
+#define R_KVX_S43_EX6 42
+#define R_KVX_S64_LO10 43
+#define R_KVX_S64_UP27 44
+#define R_KVX_S64_EX27 45
+#define R_KVX_S37_GOTADDR_LO10 46
+#define R_KVX_S37_GOTADDR_UP27 47
+#define R_KVX_S43_GOTADDR_LO10 48
+#define R_KVX_S43_GOTADDR_UP27 49
+#define R_KVX_S43_GOTADDR_EX6 50
+#define R_KVX_S64_GOTADDR_LO10 51
+#define R_KVX_S64_GOTADDR_UP27 52
+#define R_KVX_S64_GOTADDR_EX27 53
+#define R_KVX_64_DTPMOD 54
+#define R_KVX_64_DTPOFF 55
+#define R_KVX_S37_TLS_DTPOFF_LO10 56
+#define R_KVX_S37_TLS_DTPOFF_UP27 57
+#define R_KVX_S43_TLS_DTPOFF_LO10 58
+#define R_KVX_S43_TLS_DTPOFF_UP27 59
+#define R_KVX_S43_TLS_DTPOFF_EX6 60
+#define R_KVX_S37_TLS_GD_LO10 61
+#define R_KVX_S37_TLS_GD_UP27 62
+#define R_KVX_S43_TLS_GD_LO10 63
+#define R_KVX_S43_TLS_GD_UP27 64
+#define R_KVX_S43_TLS_GD_EX6 65
+#define R_KVX_S37_TLS_LD_LO10 66
+#define R_KVX_S37_TLS_LD_UP27 67
+#define R_KVX_S43_TLS_LD_LO10 68
+#define R_KVX_S43_TLS_LD_UP27 69
+#define R_KVX_S43_TLS_LD_EX6 70
+#define R_KVX_64_TPOFF 71
+#define R_KVX_S37_TLS_IE_LO10 72
+#define R_KVX_S37_TLS_IE_UP27 73
+#define R_KVX_S43_TLS_IE_LO10 74
+#define R_KVX_S43_TLS_IE_UP27 75
+#define R_KVX_S43_TLS_IE_EX6 76
+#define R_KVX_S37_TLS_LE_LO10 77
+#define R_KVX_S37_TLS_LE_UP27 78
+#define R_KVX_S43_TLS_LE_LO10 79
+#define R_KVX_S43_TLS_LE_UP27 80
+#define R_KVX_S43_TLS_LE_EX6 81
+
/* C-SKY relocs. */
#define R_CKCORE_NONE 0
@@ -3725,6 +3818,72 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_ARC_TLS_LE_S9 0x4a
#define R_ARC_TLS_LE_32 0x4b
+/* RISC-V ELF Flags */
+#define EF_RISCV_RVC 0x0001
+#define EF_RISCV_FLOAT_ABI 0x0006
+#define EF_RISCV_FLOAT_ABI_SOFT 0x0000
+#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
+#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
+#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
+
+/* RISC-V relocations. */
+#define R_RISCV_NONE 0
+#define R_RISCV_32 1
+#define R_RISCV_64 2
+#define R_RISCV_RELATIVE 3
+#define R_RISCV_COPY 4
+#define R_RISCV_JUMP_SLOT 5
+#define R_RISCV_TLS_DTPMOD32 6
+#define R_RISCV_TLS_DTPMOD64 7
+#define R_RISCV_TLS_DTPREL32 8
+#define R_RISCV_TLS_DTPREL64 9
+#define R_RISCV_TLS_TPREL32 10
+#define R_RISCV_TLS_TPREL64 11
+#define R_RISCV_BRANCH 16
+#define R_RISCV_JAL 17
+#define R_RISCV_CALL 18
+#define R_RISCV_CALL_PLT 19
+#define R_RISCV_GOT_HI20 20
+#define R_RISCV_TLS_GOT_HI20 21
+#define R_RISCV_TLS_GD_HI20 22
+#define R_RISCV_PCREL_HI20 23
+#define R_RISCV_PCREL_LO12_I 24
+#define R_RISCV_PCREL_LO12_S 25
+#define R_RISCV_HI20 26
+#define R_RISCV_LO12_I 27
+#define R_RISCV_LO12_S 28
+#define R_RISCV_TPREL_HI20 29
+#define R_RISCV_TPREL_LO12_I 30
+#define R_RISCV_TPREL_LO12_S 31
+#define R_RISCV_TPREL_ADD 32
+#define R_RISCV_ADD8 33
+#define R_RISCV_ADD16 34
+#define R_RISCV_ADD32 35
+#define R_RISCV_ADD64 36
+#define R_RISCV_SUB8 37
+#define R_RISCV_SUB16 38
+#define R_RISCV_SUB32 39
+#define R_RISCV_SUB64 40
+#define R_RISCV_GNU_VTINHERIT 41
+#define R_RISCV_GNU_VTENTRY 42
+#define R_RISCV_ALIGN 43
+#define R_RISCV_RVC_BRANCH 44
+#define R_RISCV_RVC_JUMP 45
+#define R_RISCV_RVC_LUI 46
+#define R_RISCV_GPREL_I 47
+#define R_RISCV_GPREL_S 48
+#define R_RISCV_TPREL_I 49
+#define R_RISCV_TPREL_S 50
+#define R_RISCV_RELAX 51
+#define R_RISCV_SUB6 52
+#define R_RISCV_SET6 53
+#define R_RISCV_SET8 54
+#define R_RISCV_SET16 55
+#define R_RISCV_SET32 56
+#define R_RISCV_32_PCREL 57
+
+#define R_RISCV_NUM 58
+
#ifdef __cplusplus
}
#endif
diff --git a/include/fcntl.h b/include/fcntl.h
index adcd7ef4b..ce15ceaf6 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -67,6 +67,11 @@ __BEGIN_DECLS
# define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
traversal. */
# define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname. */
+# define AT_STATX_SYNC_TYPE 0x6000
+# define AT_STATX_SYNC_AS_STAT 0x0000
+# define AT_STATX_FORCE_SYNC 0x2000
+# define AT_STATX_DONT_SYNC 0x4000
+# define AT_RECURSIVE 0x8000 /* Apply to the entire subtree. */
# endif
# define AT_EACCESS 0x200 /* Test access permitted for
effective IDs, not real IDs. */
@@ -99,8 +104,9 @@ libc_hidden_proto(fcntl64)
#endif
/* Open FILE and return a new file descriptor for it, or -1 on error.
- OFLAG determines the type of access used. If O_CREAT is on OFLAG,
- the third argument is taken as a `mode_t', the mode of the created file.
+ OFLAG determines the type of access used. If O_CREAT or O_TMPFILE
+ is on OFLAG, the third argument is taken as a `mode_t', the mode of
+ the created file.
This function is a cancellation point and therefore not marked with
__THROW. */
@@ -276,6 +282,40 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset, __off64_t __le
# endif
#endif
+#if (defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU)
+struct file_handle {
+ unsigned handle_bytes;
+ int handle_type;
+ unsigned char f_handle[];
+};
+
+#define MAX_HANDLE_SZ 128
+
+int name_to_handle_at(int dirfd, const char *pathname,
+ struct file_handle *handle, int *mount_id, int flags);
+int open_by_handle_at(int mount_fd, struct file_handle *handle, int flags);
+#endif
+
+#ifdef __USE_GNU
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_PGRP, /* Process group. */
+ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
__END_DECLS
#endif /* fcntl.h */
diff --git a/include/features.h b/include/features.h
index d6e45c2ff..b5d4e79f2 100644
--- a/include/features.h
+++ b/include/features.h
@@ -40,7 +40,8 @@
_SVID_SOURCE ISO C, POSIX, and SVID things.
_ATFILE_SOURCE Additional *at interfaces.
_GNU_SOURCE All of the above, plus GNU extensions.
- _DEFAULT_SOURCE Equivalent to defining _BSD_SOURCE and _SVID_SOURCE.
+ _DEFAULT_SOURCE Equivalent to defining _BSD_SOURCE and _SVID_SOURCE,
+ as well as _POSIX_C_SOURCE=200809L.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
_FORTIFY_SOURCE If set to numeric value > 0 additional security
@@ -142,18 +143,19 @@
/* Whether to use feature set F. */
#define __GLIBC_USE(F) __GLIBC_USE_ ## F
-/* _DEFAULT_SOURCE is equivalent to defining _BSD_SOURCE and _SVID_SOURCE
- * and vice versa. */
-#ifdef _DEFAULT_SOURCE
+/* _DEFAULT_SOURCE is equivalent to defining _BSD_SOURCE, _SVID_SOURCE
+ * and _POSIX_C_SOURCE=200809L and vice versa. */
+#if defined _DEFAULT_SOURCE || defined _BSD_SOURCE || defined _SVID_SOURCE
+# undef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
# undef _BSD_SOURCE
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
# define _SVID_SOURCE 1
-#endif
-
-#if defined _BSD_SOURCE || defined _SVID_SOURCE
-# undef _DEFAULT_SOURCE
-# define _DEFAULT_SOURCE 1
+# if _POSIX_C_SOURCE < 200809L
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# endif
#endif
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
@@ -435,4 +437,8 @@
# include <libc-internal.h>
#endif
+#if defined(__UCLIBC_USE_TIME64__) || __TARGET_ARCH_BITS__ == 64
+#define __USE_TIME_BITS64 1
+#endif
+
#endif /* features.h */
diff --git a/include/internal/time64_helpers.h b/include/internal/time64_helpers.h
new file mode 100644
index 000000000..2284aacd9
--- /dev/null
+++ b/include/internal/time64_helpers.h
@@ -0,0 +1,31 @@
+#ifndef _TIME64_HELPERS_H
+#define _TIME64_HELPERS_H
+
+#include <bits/types.h>
+#include <time.h>
+#include <stddef.h>
+
+struct __ts64_struct {
+ __S64_TYPE tv_sec;
+ __S64_TYPE tv_nsec;
+};
+
+#define TO_TS64_P(__ts) (((struct timespec *)(__ts)) ? \
+ (&(struct __ts64_struct) {.tv_sec = ((struct timespec *)(__ts))->tv_sec, \
+ .tv_nsec = ((struct timespec *)(__ts))->tv_nsec}) : NULL)
+
+struct __its64_struct {
+ __S64_TYPE interval_tv_sec;
+ __S64_TYPE interval_tv_nsec;
+ __S64_TYPE value_tv_sec;
+ __S64_TYPE value_tv_nsec;
+};
+
+#define TO_ITS64_P(__its) (((struct itimerspec *)(__its)) ? \
+ (&(struct __its64_struct) {.interval_tv_sec = ((struct itimerspec *)(__its))->it_interval.tv_sec, \
+ .interval_tv_nsec = ((struct itimerspec *)(__its))->it_interval.tv_nsec, \
+ .value_tv_sec = ((struct itimerspec *)(__its))->it_value.tv_sec, \
+ .value_tv_nsec = ((struct itimerspec *)(__its))->it_value.tv_nsec}) : NULL)
+
+
+#endif /* _TIME64_HELPERS_H */
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 4dc05c76e..2254375ad 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -156,6 +156,11 @@
# define ASM_LINE_SEP ;
#endif
+#ifndef __attribute_copy__
+/* Provide an empty definition when cdefs.h is not included. */
+# define __attribute_copy__(arg)
+#endif
+
#ifndef __ASSEMBLER__
/* GCC understands weak symbols and aliases; use its interface where
possible, instead of embedded assembly language. */
@@ -163,13 +168,13 @@
/* Define ALIASNAME as a strong alias for NAME. */
# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
# define _strong_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+ extern __typeof (name) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name);
/* Same, but does not check for type match. Use sparingly.
Example: strong_alias(stat,stat64) may fail, this one works: */
# define strong_alias_untyped(name, aliasname) \
_strong_alias_untyped(name, aliasname)
# define _strong_alias_untyped(name, aliasname) \
- extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
+ extern __typeof (aliasname) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name);
# ifdef HAVE_WEAK_SYMBOLS
@@ -182,7 +187,7 @@
If weak aliases are not available, this defines a strong alias. */
# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
# define _weak_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) __attribute_copy__ (name);
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
# define weak_extern(symbol) _weak_extern (weak symbol)
@@ -423,7 +428,8 @@ FIXME! - ?
# define __hidden_asmname2(prefix, name) #prefix name
# define __hidden_ver1(local, internal, name) \
extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
- extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
+ extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) \
+ __attribute_copy__ (name)
# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
# define hidden_data_ver(local, name) hidden_ver(local, name)
# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
index f8924c4f2..904d1933c 100644
--- a/include/net/ppp_defs.h
+++ b/include/net/ppp_defs.h
@@ -4,7 +4,7 @@
#define __need_time_t
#include <time.h>
-#include <asm/types.h>
+#include <sys/types.h>
#include <linux/ppp_defs.h>
#endif /* net/ppp_defs.h */
diff --git a/include/resolv.h b/include/resolv.h
index 9349be11f..2a82641a4 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -329,9 +329,11 @@ int res_send (const u_char *, int, u_char *, int) __THROW;
#endif
__END_DECLS
-#if 0
+#ifdef __UCLIBC_HAS_BSD_B64_NTOP_B64_PTON__
#define b64_ntop __b64_ntop
#define b64_pton __b64_pton
+#endif
+#if 0
#define dn_count_labels __dn_count_labels
#endif
#define dn_comp __dn_comp
@@ -384,8 +386,12 @@ int res_dnok (const char *) __THROW;
int sym_ston (const struct res_sym *, const char *, int *) __THROW;
const char * sym_ntos (const struct res_sym *, int, int *) __THROW;
const char * sym_ntop (const struct res_sym *, int, int *) __THROW;
+#endif
+#ifdef __UCLIBC_HAS_BSD_B64_NTOP_B64_PTON__
int b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
int b64_pton (char const *, u_char *, size_t) __THROW;
+#endif
+#if 0
int loc_aton (const char *ascii, u_char *binary) __THROW;
const char * loc_ntoa (const u_char *binary, char *ascii) __THROW;
void putlong (u_int32_t, u_char *) __THROW;
@@ -451,7 +457,7 @@ __END_DECLS
# ifndef NOT_IN_libc
# define __resp __libc_resp
# endif
-# define _res (*__resp)
+# define _res (*__res_state())
extern __thread struct __res_state *__resp attribute_tls_model_ie;
# endif
# else
diff --git a/include/setjmp.h b/include/setjmp.h
index 27cac9500..5d7df3667 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -27,21 +27,7 @@
__BEGIN_DECLS
#include <bits/setjmp.h> /* Get `__jmp_buf'. */
-#include <bits/sigset.h> /* Get `__sigset_t'. */
-
-
-/* Calling environment, plus possibly a saved signal mask. */
-struct __jmp_buf_tag
- {
- /* NOTE: The machine-dependent definitions of `__sigsetjmp'
- assume that a `jmp_buf' begins with a `__jmp_buf' and that
- `__mask_was_saved' follows it. Do not move these members
- or add others before it. */
- __jmp_buf __jmpbuf; /* Calling environment. */
- int __mask_was_saved; /* Saved the signal mask? */
- __sigset_t __saved_mask; /* Saved signal mask. */
- };
-
+#include <bits/jmp_buf_tag.h>
__BEGIN_NAMESPACE_STD
@@ -108,8 +94,10 @@ __END_DECLS
#ifdef _LIBC
extern void __longjmp(__jmp_buf __env, int __val) __THROWNL attribute_noreturn;
libc_hidden_proto(__longjmp)
-extern __typeof(longjmp) __libc_longjmp __THROWNL attribute_noreturn;
-extern __typeof(siglongjmp) __libc_siglongjmp __THROWNL attribute_noreturn;
+extern void __libc_longjmp(struct __jmp_buf_tag __env[1], int __val)
+ __THROWNL attribute_noreturn;
+extern void __libc_siglongjmp(sigjmp_buf __env, int __val)
+ __THROWNL attribute_noreturn;
extern void _longjmp_unwind(jmp_buf __env, int __val);
libc_hidden_proto(_longjmp_unwind)
extern int __sigjmp_save(sigjmp_buf __env, int __savemask) attribute_hidden;
diff --git a/include/stdlib.h b/include/stdlib.h
index 6a253cc3f..8b1375184 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -979,12 +979,14 @@ extern int getpt (void);
# endif
#endif
-#if 0 /* def __USE_BSD */
+#ifdef __USE_BSD
/* Put the 1 minute, 5 minute and 15 minute load averages into the first
NELEM elements of LOADAVG. Return the number written (never more than
three, but may be less than NELEM), or -1 if an error occurred. */
extern int getloadavg (double __loadavg[], int __nelem)
__THROW __nonnull ((1));
+
+extern void *reallocarray (void *__ptr, size_t __m, size_t __n);
#endif
#ifdef _LIBC
diff --git a/include/string.h b/include/string.h
index 8315203a4..1dc994df7 100644
--- a/include/string.h
+++ b/include/string.h
@@ -141,7 +141,8 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
libc_hidden_proto(strxfrm_l)
#endif
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_SVID || defined __USE_BSD || \
+ defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
/* Duplicate S, returning an identical malloc'd string. */
extern char *strdup (const char *__s)
__THROW __attribute_malloc__ __nonnull ((1));
@@ -343,6 +344,7 @@ extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
#endif
#ifdef __USE_BSD
+extern void explicit_bzero (void *__d, size_t __n);
# ifdef __UCLIBC_SUSV3_LEGACY__
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
extern void bcopy (const void *__src, void *__dest, size_t __n)
diff --git a/include/sys/auxv.h b/include/sys/auxv.h
new file mode 100644
index 000000000..b07026457
--- /dev/null
+++ b/include/sys/auxv.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 2022 uClibc-ng
+ This file is part of the uClibc-ng 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_AUXV_H
+#define _SYS_AUXV_H 1
+
+#include <features.h>
+#include <elf.h>
+#include <bits/hwcap.h>
+
+__BEGIN_DECLS
+
+/* Return the value associated with an Elf*_auxv_t type from the auxv list
+ passed to the program on startup. If TYPE was not present in the auxv
+ list, returns zero and sets errno to ENOENT. */
+extern unsigned long int getauxval (unsigned long int __type) __THROW;
+
+__END_DECLS
+
+#endif /* sys/auxv.h */
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index a4359a05c..5c4daebcd 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -330,6 +330,17 @@
# endif
#endif
+/* Undefine (also defined in libc-symbols.h). */
+#undef __attribute_copy__
+#if __GNUC_PREREQ (9, 0)
+/* Copies attributes from the declaration or type referenced by
+ the argument. */
+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
+#else
+# define __attribute_copy__(arg)
+#endif
+
+
/* GCC 4.3 and above allow passing all anonymous arguments of an
__extern_always_inline function to some other vararg function. */
#if __GNUC_PREREQ (4,3)
diff --git a/include/sys/personality.h b/include/sys/personality.h
index ee1de6403..fd77bdbd9 100644
--- a/include/sys/personality.h
+++ b/include/sys/personality.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2021 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,9 +13,9 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
-/* Taken verbatim from Linux 2.4 (include/linux/personality.h). */
+/* Taken verbatim from Linux 2.6 (include/linux/personality.h). */
#ifndef _SYS_PERSONALITY_H
#define _SYS_PERSONALITY_H 1
@@ -26,11 +26,17 @@
These occupy the top three bytes. */
enum
{
+ UNAME26 = 0x0020000,
+ ADDR_NO_RANDOMIZE = 0x0040000,
+ FDPIC_FUNCPTRS = 0x0080000,
MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_COMPAT_LAYOUT = 0x0200000,
+ READ_IMPLIES_EXEC = 0x0400000,
ADDR_LIMIT_32BIT = 0x0800000,
SHORT_INODE = 0x1000000,
WHOLE_SECONDS = 0x2000000,
STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000
};
/* Personality types.
@@ -41,6 +47,7 @@ enum
{
PER_LINUX = 0x0000,
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
@@ -51,14 +58,15 @@ enum
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */
PER_RISCOS = 0x000c,
PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
- PER_HPUX = 0x000f,
- PER_OSF4 = 0x0010,
+ PER_OSF4 = 0x000f,
+ PER_HPUX = 0x0010,
PER_MASK = 0x00ff,
};
diff --git a/include/sys/resource.h b/include/sys/resource.h
index 17167ed99..a5c69d84e 100644
--- a/include/sys/resource.h
+++ b/include/sys/resource.h
@@ -101,6 +101,29 @@ extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
__THROW;
libc_hidden_proto(setpriority)
+#ifdef __USE_GNU
+/* Modify and return resource limits of a process atomically. */
+# ifndef __USE_FILE_OFFSET64
+extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
+ const struct rlimit *__new_limit,
+ struct rlimit *__old_limit) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
+ enum __rlimit_resource __resource,
+ const struct rlimit *__new_limit,
+ struct rlimit *__old_limit), prlimit64);
+# else
+# define prlimit prlimit64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
+ const struct rlimit64 *__new_limit,
+ struct rlimit64 *__old_limit) __THROW;
+# endif
+#endif
+
__END_DECLS
#endif /* sys/resource.h */
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 83e1fcaa2..c8df3057f 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -281,7 +281,7 @@ libc_hidden_proto(accept4)
extern int shutdown (int __fd, int __how) __THROW;
-#if 0 /*def __USE_XOPEN2K*/
+#ifdef __USE_XOPEN2K
/* Determine wheter socket is at a out-of-band mark. */
extern int sockatmark (int __fd) __THROW;
#endif
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 079e77903..2dca6c552 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -117,7 +117,8 @@ __BEGIN_DECLS
# ifdef __S_IFLNK
# define S_IFLNK __S_IFLNK
# endif
-# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
+# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98 \
+ || defined __USE_XOPEN2K) \
&& defined __S_IFSOCK
# define S_IFSOCK __S_IFSOCK
# endif
@@ -142,7 +143,7 @@ __BEGIN_DECLS
# define S_ISLNK(mode) 0
#endif
-#if (defined __USE_BSD || defined __USE_UNIX98) \
+#if (defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K) \
&& defined __S_IFSOCK
# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
#endif
@@ -301,7 +302,7 @@ extern int lchmod (const char *__file, __mode_t __mode)
#endif
/* Set file access permissions of the file FD is open on to MODE. */
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
extern int fchmod (int __fd, __mode_t __mode) __THROW;
#endif
@@ -370,7 +371,7 @@ extern int mkfifo (const char *__path, __mode_t __mode)
extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
__THROW __nonnull ((2));
#endif
-
+
#ifdef __USE_ATFILE
/* Set file access and modification times relative to directory file
descriptor. */
@@ -385,7 +386,7 @@ libc_hidden_proto(utimensat)
/* Set file access and modification times of the file associated with FD. */
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
#endif
-
+
/* on uClibc we have unversioned struct stat and mknod.
* bits/stat.h is filled with wrong info, so we undo it here. */
#undef _STAT_VER
@@ -393,6 +394,13 @@ extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
#undef _MKNOD_VER
#define _MKNOD_VER 0
+#ifdef __UCLIBC_HAVE_STATX__
+#ifdef __USE_GNU
+# include <bits/statx.h>
+#endif
+#endif
+
+
__END_DECLS
diff --git a/include/unistd.h b/include/unistd.h
index fdde8f02f..36cd5fcb5 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -585,13 +585,11 @@ extern int execve (const char *__path, char *const __argv[],
char *const __envp[]) __THROW __nonnull ((1, 2));
libc_hidden_proto(execve)
-#if 0 /*def __USE_XOPEN2K8*/
/* Execute the file FD refers to, overlaying the running program image.
ARGV and ENVP are passed to the new program, as for `execve'. */
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
__THROW __nonnull ((2));
-#endif
-
+libc_hidden_proto(fexecve)
/* Execute PATH with arguments ARGV and environment from `environ'. */
extern int execv (const char *__path, char *const __argv[])