aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/array_length.h14
-rw-r--r--include/ctype.h21
-rw-r--r--include/elf.h13
-rw-r--r--include/libc-symbols.h2
-rw-r--r--include/rpc/rpc.h5
-rw-r--r--include/stdio.h4
-rw-r--r--include/termios.h27
-rw-r--r--include/unistd.h1
8 files changed, 72 insertions, 15 deletions
diff --git a/include/array_length.h b/include/array_length.h
index 2305e21..2a4f09f 100644
--- a/include/array_length.h
+++ b/include/array_length.h
@@ -33,4 +33,18 @@
VAR must evaluate to an array, not a pointer. */
#define array_end(var) (&(var)[array_length (var)])
+/* array_foreach (PTR, ARRAY) iterates over all the elements in an
+ array, assigning the locally defined pointer variable PTR to each
+ element in turn.
+
+ array_foreach_const (PTR, ARRAY) does the same, but *PTR is declared
+ const even if the array is not. */
+#define array_foreach(ptr, array) \
+ for (__typeof ((array)[0]) *ptr = (array) ; \
+ ptr < array_end (array) ; ptr++)
+
+#define array_foreach_const(ptr, array) \
+ for (const __typeof ((array)[0]) *ptr = (array) ; \
+ ptr < array_end (array) ; ptr++)
+
#endif /* _ARRAY_LENGTH_H */
diff --git a/include/ctype.h b/include/ctype.h
index 493a6f8..a15e5b6 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -24,33 +24,35 @@ libc_hidden_proto (toupper)
NL_CURRENT_INDIRECT. */
# include "../locale/localeinfo.h"
-# include <libc-tsd.h>
# ifndef CTYPE_EXTERN_INLINE /* Used by ctype/ctype-info.c, which see. */
# define CTYPE_EXTERN_INLINE extern inline
# endif
-__libc_tsd_define (extern, const uint16_t *, CTYPE_B)
-__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
-__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
+extern __thread const uint16_t * __libc_tsd_CTYPE_B
+ attribute_hidden attribute_tls_model_ie;
+extern __thread const int32_t * __libc_tsd_CTYPE_TOUPPER
+ attribute_hidden attribute_tls_model_ie;
+extern __thread const int32_t * __libc_tsd_CTYPE_TOLOWER
+ attribute_hidden attribute_tls_model_ie;
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
__ctype_b_loc (void)
{
- return __libc_tsd_address (const uint16_t *, CTYPE_B);
+ return &__libc_tsd_CTYPE_B;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_toupper_loc (void)
{
- return __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+ return &__libc_tsd_CTYPE_TOUPPER;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_tolower_loc (void)
{
- return __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+ return &__libc_tsd_CTYPE_TOLOWER;
}
# ifndef __NO_CTYPE
@@ -64,6 +66,11 @@ __ctype_tolower_loc (void)
# define __isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; })
# endif /* Not __NO_CTYPE. */
+/* For use in initializers. */
+extern const char _nl_C_LC_CTYPE_class[] attribute_hidden;
+extern const uint32_t _nl_C_LC_CTYPE_toupper[] attribute_hidden;
+extern const uint32_t _nl_C_LC_CTYPE_tolower[] attribute_hidden;
+
# endif /* IS_IN (libc). */
#endif /* Not _ISOMAC. */
diff --git a/include/elf.h b/include/elf.h
index 14ed67f..1424982 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -15,6 +15,19 @@
# define ELF_NOTE_NEXT_OFFSET(namesz, descsz, align) \
ALIGN_UP (ELF_NOTE_DESC_OFFSET ((namesz), (align)) + (descsz), (align))
+# ifdef HIDDEN_VAR_NEEDS_DYNAMIC_RELOC
+# define DL_ADDRESS_WITHOUT_RELOC(expr) (expr)
+# else
+/* Evaluate EXPR without run-time relocation for it. EXPR should be an
+ array, an address of an object, or a string literal. */
+# define DL_ADDRESS_WITHOUT_RELOC(expr) \
+ ({ \
+ __auto_type _result = (expr); \
+ asm ("" : "+r" (_result)); \
+ _result; \
+ })
+# endif
+
/* Some information which is not meant for the public and therefore not
in <elf.h>. */
# include <dl-dtprocnum.h>
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 91f64fd..b407fa8 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -208,7 +208,7 @@
#define __make_section_unallocated(section_string) \
asm (".section " section_string "\n\t.previous");
-/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
+/* Tacking on "\n\t#" to the section name makes gcc put its bogus
section attributes on what looks like a comment to the assembler. */
#ifdef HAVE_SECTION_QUOTES
# define __sec_comment "\"\n\t#\""
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index f5cee6c..ba96783 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -3,8 +3,6 @@
# ifndef _ISOMAC
-#include <libc-tsd.h>
-
/* Now define the internal interfaces. */
extern unsigned long _create_xid (void);
@@ -47,7 +45,8 @@ extern void __rpc_thread_key_cleanup (void) attribute_hidden;
extern void __rpc_thread_destroy (void) attribute_hidden;
-__libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
+extern __thread struct rpc_thread_variables *__libc_tsd_RPC_VARS
+ attribute_hidden attribute_tls_model_ie;
#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
diff --git a/include/stdio.h b/include/stdio.h
index e48d709..3d917db 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -173,6 +173,10 @@ libc_hidden_proto (__fortify_fail)
/* The maximum number of varargs allowed in a __libc_message format string */
#define LIBC_MESSAGE_MAX_ARGS 4
+#define IOVEC_MAX_ERR_MSG "Fatal glibc error: Internal " \
+ "__libc_message error. Too many arguments.\n"
+#define IOVEC_MAX_ERR_MSG_LEN (sizeof (IOVEC_MAX_ERR_MSG) - 1)
+
_Noreturn void __libc_message_impl (const char *__fnt, ...) attribute_hidden
__attribute__ ((__format__ (__printf__, 1, 2)));
diff --git a/include/termios.h b/include/termios.h
index e2c35eb..d466082 100644
--- a/include/termios.h
+++ b/include/termios.h
@@ -2,7 +2,18 @@
#include <termios/termios.h>
#ifndef _ISOMAC
-/* Now define the internal interfaces. */
+extern speed_t __cfgetospeed (const struct termios *__termios_p);
+extern speed_t __cfgetispeed (const struct termios *__termios_p);
+extern int __cfsetospeed (struct termios *__termios_p, speed_t __speed);
+extern int __cfsetispeed (struct termios *__termios_p, speed_t __speed);
+extern int __cfsetspeed (struct termios *__termios_p, speed_t __speed);
+
+extern baud_t __cfgetobaud (const struct termios *__termios_p);
+extern baud_t __cfgetibaud (const struct termios *__termios_p);
+extern int __cfsetobaud (struct termios *__termios_p, baud_t __baud);
+extern int __cfsetibaud (struct termios *__termios_p, baud_t __baud);
+extern int __cfsetbaud (struct termios *__termios_p, baud_t __baud);
+
extern int __tcgetattr (int __fd, struct termios *__termios_p);
extern int __tcsetattr (int __fd, int __optional_actions,
const struct termios *__termios_p);
@@ -10,9 +21,17 @@ extern int __tcsetattr (int __fd, int __optional_actions,
extern int __libc_tcdrain (int __fd);
libc_hidden_proto (__tcgetattr)
-libc_hidden_proto (tcsetattr)
-libc_hidden_proto (cfsetispeed)
-libc_hidden_proto (cfsetospeed)
+libc_hidden_proto (__tcsetattr)
+libc_hidden_proto (__cfgetispeed)
+libc_hidden_proto (__cfgetospeed)
+libc_hidden_proto (__cfsetispeed)
+libc_hidden_proto (__cfsetospeed)
+libc_hidden_proto (__cfsetspeed)
+libc_hidden_proto (__cfgetibaud)
+libc_hidden_proto (__cfgetobaud)
+libc_hidden_proto (__cfsetibaud)
+libc_hidden_proto (__cfsetobaud)
+libc_hidden_proto (__cfsetbaud)
#endif
#endif
diff --git a/include/unistd.h b/include/unistd.h
index e241603..376ab5a 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -152,6 +152,7 @@ libc_hidden_proto (__ttyname_r)
extern __pid_t _Fork (void);
libc_hidden_proto (_Fork);
extern int __isatty (int __fd) attribute_hidden;
+extern int __isatty_nostatus (int __fd) attribute_hidden;
extern int __link (const char *__from, const char *__to);
extern int __symlink (const char *__from, const char *__to);
extern int __symlinkat (const char *__from, int __fd, const char *__to);