summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/alloca.h2
-rw-r--r--include/ctype.h7
-rw-r--r--include/elf.h45
-rw-r--r--include/errno.h12
-rw-r--r--include/fcntl.h3
-rw-r--r--include/features.h7
-rw-r--r--include/ftw.h4
-rw-r--r--include/langinfo.h7
-rw-r--r--include/libc-internal.h5
-rw-r--r--include/libintl.h5
-rw-r--r--include/link.h13
-rw-r--r--include/locale.h9
-rw-r--r--include/net/if_arp.h4
-rw-r--r--include/net/route.h4
-rw-r--r--include/netinet/ether.h1
-rw-r--r--include/netinet/icmp6.h4
-rw-r--r--include/netinet/in.h31
-rw-r--r--include/netinet/ip.h38
-rw-r--r--include/netinet/udp.h12
-rw-r--r--include/nl_types.h4
-rw-r--r--include/paths.h1
-rw-r--r--include/protocols/timed.h1
-rw-r--r--include/resolv.h20
-rw-r--r--include/sgtty.h6
-rw-r--r--include/signal.h11
-rw-r--r--include/stdint.h1
-rw-r--r--include/stdio.h1
-rw-r--r--include/stdlib.h55
-rw-r--r--include/string.h5
-rw-r--r--include/sys/wait.h30
-rw-r--r--include/time.h2
-rw-r--r--include/unistd.h2
-rw-r--r--include/wchar-stub.h1
-rw-r--r--include/wchar.h12
-rw-r--r--include/wctype.h4
-rw-r--r--include/xlocale.h31
36 files changed, 281 insertions, 119 deletions
diff --git a/include/alloca.h b/include/alloca.h
index 2565b4835..4790b300b 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -67,6 +67,8 @@ extern void *alloca (size_t __size) __THROW;
# define extend_alloca(buf, len, newlen) \
alloca (((len) = (newlen)))
# endif
+
+extern int __libc_alloca_cutoff (size_t size);
#endif
__END_DECLS
diff --git a/include/ctype.h b/include/ctype.h
index dcfeb1b3e..d09f0526b 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -345,22 +345,15 @@ libc_hidden_proto(isascii_l)
# endif
/* Return the lowercase version of C in locale L. */
-/* "ordinary" ctype.h has no __tolower, why we try to have it?
- * remove after 0.9.31
- *extern int __tolower_l (int __c, __locale_t __l) __THROW; */
extern int tolower_l (int __c, __locale_t __l) __THROW;
libc_hidden_proto(tolower_l)
/* Return the uppercase version of C. */
-/*extern int __toupper_l (int __c, __locale_t __l) __THROW; */
extern int toupper_l (int __c, __locale_t __l) __THROW;
-libc_hidden_proto(toupper_l)
# 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))
-/*# define __tolower_l(c, locale) tolower_l((c), (locale)) */
-/*# define __toupper_l(c, locale) toupper_l((c), (locale)) */
# endif /* Optimizing gcc */
diff --git a/include/elf.h b/include/elf.h
index b86aa52be..d71691eb3 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -268,6 +268,7 @@ typedef struct
#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
#define EM_CRX 114 /* National Semiconductor CRX */
#define EM_NUM 95
+#define EM_TI_C6000 140
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
@@ -3063,6 +3064,50 @@ typedef Elf32_Addr Elf32_Conflict;
/* Keep this the last entry. */
#define R_XTENSA_NUM 50
+/* C6X specific relocs */
+#define R_C6000_NONE 0
+#define R_C6000_ABS32 1
+#define R_C6000_ABS16 2
+#define R_C6000_ABS8 3
+#define R_C6000_PCR_S21 4
+#define R_C6000_PCR_S12 5
+#define R_C6000_PCR_S10 6
+#define R_C6000_PCR_S7 7
+#define R_C6000_ABS_S16 8
+#define R_C6000_ABS_L16 9
+#define R_C6000_ABS_H16 10
+#define R_C6000_SBR_U15_B 11
+#define R_C6000_SBR_U15_H 12
+#define R_C6000_SBR_U15_W 13
+#define R_C6000_SBR_S16 14
+#define R_C6000_SBR_L16_B 15
+#define R_C6000_SBR_L16_H 16
+#define R_C6000_SBR_L16_W 17
+#define R_C6000_SBR_H16_B 18
+#define R_C6000_SBR_H16_H 19
+#define R_C6000_SBR_H16_W 20
+#define R_C6000_SBR_GOT_U15_W 21
+#define R_C6000_SBR_GOT_L16_W 22
+#define R_C6000_SBR_GOT_H16_W 23
+#define R_C6000_DSBT_INDEX 24
+#define R_C6000_PREL31 25
+#define R_C6000_COPY 26
+#define R_C6000_JUMP_SLOT 27
+#define R_C6000_SBR_GOT32 28
+#define R_C6000_PCR_H16 29
+#define R_C6000_PCR_L16 30
+#define R_C6000_ALIGN 253
+#define R_C6000_FPHEAD 254
+#define R_C6000_NOCMP 255
+
+/* C6x specific values for the Dyn d_tag field. */
+#define DT_C6000_DSBT_BASE (DT_LOPROC + 0)
+#define DT_C6000_DSBT_SIZE (DT_LOPROC + 1)
+#define DT_C6000_PREEMPTMAP (DT_LOPROC + 2)
+#define DT_C6000_DSBT_INDEX (DT_LOPROC + 3)
+
+#define DT_C6000_NUM 4
+
#ifdef __cplusplus
}
#endif
diff --git a/include/errno.h b/include/errno.h
index 85268f053..7e1f583a8 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -58,7 +58,12 @@ extern const char *program_invocation_name, *program_invocation_short_name;
__END_DECLS
-#if defined _LIBC && defined __UCLIBC_HAS_TLS__
+#ifdef _LIBC
+#ifdef IS_IN_rtld
+# undef errno
+# define errno _dl_errno
+extern int _dl_errno; /* attribute_hidden */
+#elif defined __UCLIBC_HAS_TLS__
# if !defined NOT_IN_libc || defined IS_IN_libpthread
# undef errno
# ifndef NOT_IN_libc
@@ -73,10 +78,7 @@ extern __thread int errno attribute_tls_model_ie;
#ifndef __set_errno
#define __set_errno(val) (errno = (val))
#endif
-
-#ifndef __ASSEMBLER__
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-#endif
+#endif /* _LIBC */
#endif /* _ERRNO_H */
diff --git a/include/fcntl.h b/include/fcntl.h
index 3a9873461..26ad1fe6d 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -234,7 +234,10 @@ extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
+#ifdef _LIBC
extern int __fcntl_nocancel (int fd, int cmd, ...);
+libc_hidden_proto(__fcntl_nocancel)
+#endif
__END_DECLS
diff --git a/include/features.h b/include/features.h
index 1d47b5660..41e83a93f 100644
--- a/include/features.h
+++ b/include/features.h
@@ -198,9 +198,12 @@
# define __OPTIMIZE_SIZE__ 1
/* disable unsupported features */
-# undef _FORTIFY_SOURCE
# undef __LDBL_COMPAT
+# ifndef __UCLIBC_HAS_FORTIFY__
+# undef _FORTIFY_SOURCE
+# endif
+
# ifndef __UCLIBC_HAS_THREADS__
# if defined _REENTRANT || defined _THREAD_SAFE
# warning requested reentrant code, but thread support was disabled
@@ -433,7 +436,7 @@ uClibc was built without large file support enabled.
*/
#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
- && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
+ && (defined __extern_inline || defined __GNUC_GNU_INLINE__ || defined __GNUC_STDC_INLINE__)
# define __USE_EXTERN_INLINES 1
#endif
diff --git a/include/ftw.h b/include/ftw.h
index 84f3e14a8..c79924dc8 100644
--- a/include/ftw.h
+++ b/include/ftw.h
@@ -129,7 +129,7 @@ typedef int (*__nftw64_func_t) (__const char *__filename,
# endif
#endif
-#if __UCLIBC_HAS_FTW__
+#ifdef __UCLIBC_HAS_FTW__
/* Call a function on every element in a directory tree.
This function is a possible cancellation point and therefore not
@@ -151,7 +151,7 @@ extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
# endif
#endif
-#if __UCLIBC_HAS_NFTW__ && defined __USE_XOPEN_EXTENDED
+#if defined __UCLIBC_HAS_NFTW__ && defined __USE_XOPEN_EXTENDED
/* Call a function on every element in a directory tree. FLAG allows
to specify the behaviour more detailed.
diff --git a/include/langinfo.h b/include/langinfo.h
index 2e2ee4ec8..c7cddc0fc 100644
--- a/include/langinfo.h
+++ b/include/langinfo.h
@@ -1,5 +1,5 @@
/* Access to locale-dependent parameters.
- Copyright (C) 1995-2002,2003,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002,2003,2004,2005,2009 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
@@ -352,6 +352,7 @@ enum
_NL_CTYPE_TRANSLIT_IGNORE_LEN,
_NL_CTYPE_TRANSLIT_IGNORE,
_NL_CTYPE_MAP_TO_NONASCII,
+ _NL_CTYPE_NONASCII_CASE,
_NL_CTYPE_EXTRA_MAP_1,
_NL_CTYPE_EXTRA_MAP_2,
_NL_CTYPE_EXTRA_MAP_3,
@@ -620,7 +621,7 @@ extern char *nl_langinfo (nl_item __item) __THROW;
libc_hidden_proto(nl_langinfo)
-#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
+#if defined __USE_XOPEN2K && defined __UCLIBC_HAS_XLOCALE__
/* This interface is for the extended locale model. See <locale.h> for
more information. */
@@ -628,7 +629,7 @@ libc_hidden_proto(nl_langinfo)
# include <xlocale.h>
/* Just like nl_langinfo but get the information from the locale object L. */
-extern char *nl_langinfo_l (nl_item __item, __locale_t l);
+extern char *nl_langinfo_l (nl_item __item, __locale_t __l);
libc_hidden_proto(nl_langinfo_l)
#endif
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 443b1fc50..3ac0b0509 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -65,6 +65,11 @@ libc_hidden_proto(__glibc_strerror_r)
/* internal access to program name */
extern const char *__uclibc_progname attribute_hidden;
+# ifdef __UCLIBC_HAS_FORTIFY__
+extern void __chk_fail(void) attribute_noreturn;
+libc_hidden_proto(__chk_fail)
+# endif
+
# endif /* IS_IN_libc */
#endif /* __ASSEMBLER__ */
diff --git a/include/libintl.h b/include/libintl.h
index ba57f1698..be3969fff 100644
--- a/include/libintl.h
+++ b/include/libintl.h
@@ -34,11 +34,6 @@
__BEGIN_DECLS
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "mjn3 FIXME: gettext has a prototype but isn't defined."
-#warning "mjn3 FIXME: __OPTIMIZE__ is never defined."
-#endif
-
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
diff --git a/include/link.h b/include/link.h
index cbef6165a..185ee701e 100644
--- a/include/link.h
+++ b/include/link.h
@@ -1,6 +1,6 @@
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
- Copyright (C) 1995-2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-2001, 2004, 2005, 2006, 2010 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
@@ -83,6 +83,9 @@ extern ElfW(Dyn) _DYNAMIC[];
#ifdef __FDPIC__
# include <bits/elf-fdpic.h>
#endif
+#ifdef __DSBT__
+# include <bits/elf-dsbt.h>
+#endif
/* Structure describing a loaded shared object. The `l_next' and `l_prev'
members form a chain of all the shared objects loaded at startup.
@@ -98,8 +101,12 @@ struct link_map
#ifdef __FDPIC__
struct elf32_fdpic_loadaddr l_addr;
#else
+#ifdef __DSBT__
+ struct elf32_dsbt_loadaddr l_addr;
+#else
ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
#endif
+#endif
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
@@ -178,8 +185,12 @@ struct dl_phdr_info
#ifdef __FDPIC__
struct elf32_fdpic_loadaddr dlpi_addr;
#else
+#ifdef __DSBT__
+ struct elf32_dsbt_loadaddr dlpi_addr;
+#else
ElfW(Addr) dlpi_addr;
#endif
+#endif
const char *dlpi_name;
const ElfW(Phdr) *dlpi_phdr;
ElfW(Half) dlpi_phnum;
diff --git a/include/locale.h b/include/locale.h
index b740908f0..b79626a46 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,95-99,2000,01,02 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-2002,2007,2009 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
@@ -133,7 +133,7 @@ libc_hidden_proto(localeconv)
__END_NAMESPACE_STD
-#if defined __USE_GNU && defined __UCLIBC_HAS_LOCALE__
+#if defined __USE_XOPEN2K8 && defined __UCLIBC_HAS_LOCALE__
/* The concept of one static locale per category is not very well
thought out. Many applications will need to process its data using
information from several different locales. Another application is
@@ -150,6 +150,7 @@ __END_NAMESPACE_STD
# include <xlocale.h>
#endif
+/* POSIX 2008 makes locale_t official. */
typedef __locale_t locale_t;
/* Return a reference to a data structure representing a set of locale
@@ -170,9 +171,6 @@ libc_hidden_proto(newlocale)
# define LC_COLLATE_MASK (1 << __LC_COLLATE)
# define LC_MONETARY_MASK (1 << __LC_MONETARY)
# define LC_MESSAGES_MASK (1 << __LC_MESSAGES)
-#ifdef L_newlocale
-#warning mask defines for extra locale categories
-#endif /* L_newlocale - uClibc note */
#ifdef LC_PAPER
# define LC_PAPER_MASK (1 << __LC_PAPER)
# define LC_NAME_MASK (1 << __LC_NAME)
@@ -206,7 +204,6 @@ libc_hidden_proto(newlocale)
/* Return a duplicate of the set of locale in DATASET. All usage
counters are increased if necessary. */
extern __locale_t duplocale (__locale_t __dataset) __THROW;
-libc_hidden_proto(duplocale)
/* Free the data associated with a locale dataset previously returned
by a call to `setlocale_r'. */
diff --git a/include/net/if_arp.h b/include/net/if_arp.h
index 9608652ee..97cb61f62 100644
--- a/include/net/if_arp.h
+++ b/include/net/if_arp.h
@@ -1,5 +1,5 @@
/* Definitions for Address Resolution Protocol.
- Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2001,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -128,6 +128,8 @@ struct arphdr
#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
+#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 header. */
+#define ARPHRD_IEEE802154_PHY 805 /* IEEE 802.15.4 PHY header. */
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
#define ARPHRD_NONE 0xFFFE /* Zero header length. */
diff --git a/include/net/route.h b/include/net/route.h
index da5c810c7..ea6c9b941 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -55,6 +55,7 @@ struct rtentry
#define rt_mss rt_mtu
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
struct in6_rtmsg
{
struct in6_addr rtmsg_dst;
@@ -68,6 +69,7 @@ struct in6_rtmsg
u_int32_t rtmsg_flags;
int rtmsg_ifindex;
};
+#endif
#define RTF_UP 0x0001 /* Route usable. */
@@ -129,6 +131,7 @@ struct in6_rtmsg
#define RT_CLASS_MAX 255
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
#define RTMSG_ACK NLMSG_ACK
#define RTMSG_OVERRUN NLMSG_OVERRUN
@@ -141,5 +144,6 @@ struct in6_rtmsg
#define RTMSG_CONTROL 0x40
#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed. */
+#endif
#endif /* net/route.h */
diff --git a/include/netinet/ether.h b/include/netinet/ether.h
index 2e52679fa..bd9aa982b 100644
--- a/include/netinet/ether.h
+++ b/include/netinet/ether.h
@@ -45,7 +45,6 @@ extern struct ether_addr *ether_aton_r (__const char *__asc,
struct ether_addr *__addr) __THROW;
libc_hidden_proto(ether_aton_r)
-
/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr)
__THROW;
diff --git a/include/netinet/icmp6.h b/include/netinet/icmp6.h
index 225e49e07..8662cca8a 100644
--- a/include/netinet/icmp6.h
+++ b/include/netinet/icmp6.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1997,2000,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1997,2000,2006,2009 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
@@ -339,7 +339,7 @@ struct nd_opt_home_agent_info
uint8_t nd_opt_home_agent_info_type;
uint8_t nd_opt_home_agent_info_len;
uint16_t nd_opt_home_agent_info_reserved;
- int16_t nd_opt_home_agent_info_preference;
+ uint16_t nd_opt_home_agent_info_preference;
uint16_t nd_opt_home_agent_info_lifetime;
};
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 6327001ee..b42121ae3 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -194,6 +194,7 @@ struct in_addr
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
/* IPv6 address */
struct in6_addr
{
@@ -212,14 +213,19 @@ struct in6_addr
#endif
};
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+#define INET6_ADDRSTRLEN 46
+#endif
+
+#ifdef __UCLIBC_HAS_IPV6__
extern const struct in6_addr in6addr_any; /* :: */
extern const struct in6_addr in6addr_loopback; /* ::1 */
libc_hidden_proto(in6addr_loopback)
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+#endif
#define INET_ADDRSTRLEN 16
-#define INET6_ADDRSTRLEN 46
#if 1 /*def __UCLIBC_HAS_IPV4__*/
@@ -238,6 +244,7 @@ struct sockaddr_in
};
#endif
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
/* Ditto, for IPv6. */
struct sockaddr_in6
{
@@ -247,6 +254,7 @@ struct sockaddr_in6
struct in6_addr sin6_addr; /* IPv6 address */
uint32_t sin6_scope_id; /* IPv6 scope-id */
};
+#endif
#if defined __USE_MISC || defined __USE_GNU
@@ -274,6 +282,7 @@ struct ip_mreq_source
#endif
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
/* Likewise, for IPv6. */
struct ipv6_mreq
{
@@ -283,6 +292,7 @@ struct ipv6_mreq
/* local interface */
unsigned int ipv6mr_interface;
};
+#endif
#if defined __USE_MISC || defined __USE_GNU
@@ -403,6 +413,7 @@ libc_hidden_proto(htons)
# endif
#endif
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
#define IN6_IS_ADDR_UNSPECIFIED(a) \
(((__const uint32_t *) (a))[0] == 0 \
&& ((__const uint32_t *) (a))[1] == 0 \
@@ -441,6 +452,7 @@ libc_hidden_proto(htons)
&& (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
&& (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
&& (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
+#endif
#if defined __USE_MISC || defined __USE_GNU
/* Bind socket to a privileged IP port. */
@@ -455,6 +467,7 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
#endif
+#if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
@@ -474,9 +487,11 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+#endif
-#if defined __USE_GNU && defined __UCLIBC_HAS_IPV6__
+#ifdef __USE_GNU
+# if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__
/* IPv6 packet information. */
struct in6_pktinfo
{
@@ -490,9 +505,9 @@ struct ip6_mtuinfo
struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
uint32_t ip6m_mtu; /* path MTU in host byte order */
};
-#endif
-#if 0 /*def __USE_GNU*/
+
+# if 0
/* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */
extern int inet6_option_space (int __nbytes)
__THROW __attribute_deprecated__;
@@ -540,8 +555,11 @@ extern int inet6_rth_reverse (__const void *__in, void *__out) __THROW;
extern int inet6_rth_segments (__const void *__bp) __THROW;
extern struct in6_addr *inet6_rth_getaddr (__const void *__bp, int __index)
__THROW;
+# endif
+# endif
+# if 0
/* Multicast source filter support. */
/* Get IPv4 source filter. */
@@ -571,6 +589,7 @@ extern int setsourcefilter (int __s, uint32_t __interface_addr,
socklen_t __grouplen, uint32_t __fmode,
uint32_t __numsrc,
__const struct sockaddr_storage *__slist) __THROW;
+# endif
#endif /* use GNU */
__END_DECLS
diff --git a/include/netinet/ip.h b/include/netinet/ip.h
index fc9144052..38bd7556d 100644
--- a/include/netinet/ip.h
+++ b/include/netinet/ip.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2000,2009 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
@@ -153,6 +154,41 @@ struct ip_timestamp
#define IP_MAXPACKET 65535 /* maximum packet size */
/*
+ * Definitions for Explicit Congestion Notification (ECN)
+ *
+ * Taken from RFC-3168, Section 5.
+ */
+
+#define IPTOS_ECN_MASK 0x03
+#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
+#define IPTOS_ECN_NOT_ECT 0x00
+#define IPTOS_ECN_ECT1 0x01
+#define IPTOS_ECN_ECT0 0x02
+#define IPTOS_ECN_CE 0x03
+
+/*
+ * Definitions for IP differentiated services code points (DSCP)
+ *
+ * Taken from RFC-2597, Section 6 and RFC-2598, Section 2.3.
+ */
+
+#define IPTOS_DSCP_MASK 0xfc
+#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
+#define IPTOS_DSCP_AF11 0x28
+#define IPTOS_DSCP_AF12 0x30
+#define IPTOS_DSCP_AF13 0x38
+#define IPTOS_DSCP_AF21 0x48
+#define IPTOS_DSCP_AF22 0x50
+#define IPTOS_DSCP_AF23 0x58
+#define IPTOS_DSCP_AF31 0x68
+#define IPTOS_DSCP_AF32 0x70
+#define IPTOS_DSCP_AF33 0x78
+#define IPTOS_DSCP_AF41 0x88
+#define IPTOS_DSCP_AF42 0x90
+#define IPTOS_DSCP_AF43 0x98
+#define IPTOS_DSCP_EF 0xb8
+
+/*
* Definitions for IP type of service (ip_tos)
*/
#define IPTOS_TOS_MASK 0x1E
diff --git a/include/netinet/udp.h b/include/netinet/udp.h
index 45b69f749..ae1beb9e1 100644
--- a/include/netinet/udp.h
+++ b/include/netinet/udp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96, 97, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1995-1997,2004,2009 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
@@ -74,6 +74,16 @@ struct udphdr
};
#endif
+/* UDP socket options */
+#define UDP_CORK 1 /* Never send partially complete segments. */
+#define UDP_ENCAP 100 /* Set the socket to accept
+ encapsulated packets. */
+
+/* UDP encapsulation types */
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
+#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
+
#define SOL_UDP 17 /* sockopt level for UDP */
#endif /* netinet/udp.h */
diff --git a/include/nl_types.h b/include/nl_types.h
index d6d48ecd9..e54612af7 100644
--- a/include/nl_types.h
+++ b/include/nl_types.h
@@ -21,11 +21,13 @@
#include <features.h>
+#ifndef __UCLIBC_STRICT_HEADERS__
/* The default message set used by the gencat program. */
#define NL_SETD 1
/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
#define NL_CAT_LOCALE 1
+#endif
__BEGIN_DECLS
@@ -34,8 +36,10 @@ __BEGIN_DECLS
#warning "mjn3 FIXME: None of these prototypes have implementations."
#endif
+#ifndef __UCLIBC_STRICT_HEADERS__
/* Message catalog descriptor type. */
typedef void *nl_catd;
+#endif
/* Type used by `nl_langinfo'. */
typedef int nl_item;
diff --git a/include/paths.h b/include/paths.h
index 305937fc5..0b4035d22 100644
--- a/include/paths.h
+++ b/include/paths.h
@@ -44,6 +44,7 @@
#define _PATH_DEVDB "/var/run/dev.db"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_DRUM "/dev/drum"
+#define _PATH_GSHADOW "/etc/gshadow"
#define _PATH_KLOG "/proc/kmsg"
#define _PATH_KMEM "/dev/kmem"
#define _PATH_LASTLOG "/var/log/lastlog"
diff --git a/include/protocols/timed.h b/include/protocols/timed.h
index 8101e9924..f50061cc1 100644
--- a/include/protocols/timed.h
+++ b/include/protocols/timed.h
@@ -32,6 +32,7 @@
#ifndef _PROTOCOLS_TIMED_H
#define _PROTOCOLS_TIMED_H 1
+#include <features.h>
#ifdef __UCLIBC_HAS_RPC__
#include <rpc/types.h>
#endif
diff --git a/include/resolv.h b/include/resolv.h
index b9ce1e2a2..cba26f004 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -282,46 +282,61 @@ extern struct __res_state *__res_state(void) __attribute__ ((__const__));
__END_DECLS
#define _res (*__res_state())
+#if 0
#define fp_nquery __fp_nquery
#define fp_query __fp_query
#define hostalias __hostalias
#define p_query __p_query
+#endif
#define res_close __res_close
#define res_init __res_init
+#if 0
#define res_isourserver __res_isourserver
#define res_mkquery __res_mkquery
+#endif
#define res_query __res_query
#define res_querydomain __res_querydomain
#define res_search __res_search
+#if 0
#define res_send __res_send
+#endif
__BEGIN_DECLS
+#if 0
void fp_nquery (const u_char *, int, FILE *) __THROW;
void fp_query (const u_char *, FILE *) __THROW;
const char * hostalias (const char *) __THROW;
void p_query (const u_char *) __THROW;
+#endif
#ifdef __UCLIBC_HAS_BSD_RES_CLOSE__
void res_close (void) __THROW;
#endif
int res_init (void) __THROW;
libc_hidden_proto(res_init)
+#if 0
int res_isourserver (const struct sockaddr_in *) __THROW;
int res_mkquery (int, const char *, int, int, const u_char *,
int, const u_char *, u_char *, int) __THROW;
+#endif
int res_query (const char *, int, int, u_char *, int) __THROW;
libc_hidden_proto(res_query)
int res_querydomain (const char *, const char *, int, int,
u_char *, int) __THROW;
libc_hidden_proto(res_querydomain)
int res_search (const char *, int, int, u_char *, int) __THROW;
+#if 0
int res_send (const u_char *, int, u_char *, int) __THROW;
+#endif
__END_DECLS
+#if 0
#define b64_ntop __b64_ntop
#define b64_pton __b64_pton
#define dn_comp __dn_comp
#define dn_count_labels __dn_count_labels
+#endif
#define dn_expand __dn_expand
+#if 0
#define dn_skipname __dn_skipname
#define fp_resstat __fp_resstat
#define loc_aton __loc_aton
@@ -359,7 +374,9 @@ __END_DECLS
#define sym_ntop __sym_ntop
#define sym_ntos __sym_ntos
#define sym_ston __sym_ston
+#endif
__BEGIN_DECLS
+#if 0
int res_hnok (const char *) __THROW;
int res_ownok (const char *) __THROW;
int res_mailok (const char *) __THROW;
@@ -389,8 +406,10 @@ char * p_secstodate (u_long) __THROW;
int dn_count_labels (const char *) __THROW;
int dn_comp (const char *, u_char *, int, u_char **, u_char **)
__THROW;
+#endif
int dn_expand (const u_char *, const u_char *, const u_char *,
char *, int) __THROW;
+#if 0
u_int res_randomid (void) __THROW;
int res_nameinquery (const char *, int, int,
const u_char *, const u_char *) __THROW;
@@ -418,6 +437,7 @@ int res_nmkquery (res_state, int, const char *, int, int,
int res_nsend (res_state, const u_char *, int, u_char *, int)
__THROW;
void res_nclose (res_state) __THROW;
+#endif
__END_DECLS
# if _LIBC
diff --git a/include/sgtty.h b/include/sgtty.h
index 5b2bc4184..f773c3123 100644
--- a/include/sgtty.h
+++ b/include/sgtty.h
@@ -19,21 +19,27 @@
#ifndef _SGTTY_H
#define _SGTTY_H 1
+#warning useless header on uClibc
+
#include <features.h>
#include <sys/ioctl.h>
+#ifndef __UCLIBC_STRICT_HEADERS__
/* On some systems this type is not defined by <bits/ioctl-types.h>;
in that case, the functions are just stubs that return ENOSYS. */
struct sgttyb;
+#endif
__BEGIN_DECLS
+#if 0
/* Fill in *PARAMS with terminal parameters associated with FD. */
extern int gtty (int __fd, struct sgttyb *__params) __THROW;
/* Set the terminal parameters associated with FD to *PARAMS. */
extern int stty (int __fd, __const struct sgttyb *__params) __THROW;
+#endif
__END_DECLS
diff --git a/include/signal.h b/include/signal.h
index 0a09c7ad4..37ed29780 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -310,6 +310,9 @@ extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
__THROW. */
extern int sigwaitinfo (__const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __nonnull ((1));
+#ifdef _LIBC
+extern __typeof(sigwaitinfo) __sigwaitinfo attribute_hidden;
+#endif
libc_hidden_proto(sigwaitinfo)
/* Select any of pending signals from SET and place information in INFO.
@@ -321,6 +324,9 @@ extern int sigtimedwait (__const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
__const struct timespec *__restrict __timeout)
__nonnull ((1));
+#ifdef _LIBC
+extern __typeof(sigtimedwait) __sigtimedwait attribute_hidden;
+#endif
libc_hidden_proto(sigtimedwait)
/* Send signal SIG to the process PID. Associate data in VAL with the
@@ -386,14 +392,17 @@ extern int siginterrupt (int __sig, int __interrupt) __THROW;
# include <bits/sigstack.h>
# ifdef __USE_XOPEN
/* This will define `ucontext_t' and `mcontext_t'. */
-# include <ucontext.h>
+/* SuSv4 obsoleted include/ucontext.h */
+# include <sys/ucontext.h>
# endif
+# if 0
/* Run signals handlers on the stack specified by SS (if not NULL).
If OSS is not NULL, it is filled in with the old signal stack status.
This interface is obsolete and on many platform not implemented. */
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
__THROW __attribute_deprecated__;
+# endif
/* Alternate signal handler stack interface.
This interface should always be preferred over `sigstack'. */
diff --git a/include/stdint.h b/include/stdint.h
index 465a1b5bc..a0d7da947 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -238,6 +238,7 @@ typedef unsigned long long int uintmax_t;
# define UINTPTR_MAX (4294967295U)
# endif
+
#if !defined(__H8300H__) && !defined(__H8300S__)
/* Minimum for largest signed integral type. */
# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
diff --git a/include/stdio.h b/include/stdio.h
index 3c86f256b..45d3e4991 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -450,7 +450,6 @@ libc_hidden_proto(vfscanf)
marked with __THROW. */
extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
-libc_hidden_proto(vscanf)
/* Read formatted input from S into argument list ARG. */
extern int vsscanf (__const char *__restrict __s,
diff --git a/include/stdlib.h b/include/stdlib.h
index 300edf04a..e9a8b84c2 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -50,9 +50,9 @@ __BEGIN_DECLS
as well as POSIX.1 use of `int' for the status word. */
# if defined __GNUC__ && !defined __cplusplus
-# define __WAIT_INT(status) \
- (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
- __u.__in = (status); __u.__i; }))
+# define __WAIT_INT(status) \
+ (__extension__ (((union { __typeof(status) __in; int __i; }) \
+ { .__in = (status) }).__i))
# else
# define __WAIT_INT(status) (*(int *) &(status))
# endif
@@ -143,9 +143,11 @@ __END_NAMESPACE_C99
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
#else
#ifdef __UCLIBC_HAS_WCHAR__
-#define MB_CUR_MAX (_stdlib_mb_cur_max ())
+# define MB_CUR_MAX (_stdlib_mb_cur_max ())
extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
libc_hidden_proto(_stdlib_mb_cur_max)
+#else
+# define MB_CUR_MAX 1
#endif
#endif
@@ -163,7 +165,6 @@ libc_hidden_proto(atoi)
/* Convert a string to a long integer. */
extern long int atol (__const char *__nptr)
__THROW __attribute_pure__ __nonnull ((1)) __wur;
-libc_hidden_proto(atol)
__END_NAMESPACE_STD
#if defined __USE_ISOC99 || defined __USE_MISC
@@ -244,14 +245,14 @@ __END_NAMESPACE_C99
#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
/* The concept of one static locale per category is not very well
thought out. Many applications will need to process its data using
- information from several different locales. Another application is
+ information from several different locales. Another problem is
the implementation of the internationalization handling in the
- upcoming ISO C++ standard library. To support this another set of
- the functions using locale data exist which have an additional
+ ISO C++ standard library. To support this another set of
+ the functions using locale data exist which take an additional
argument.
- Attention: all these functions are *not* standardized in any form.
- This is a proof-of-concept implementation. */
+ Attention: even though several *_l interfaces are part of POSIX:2008,
+ these are not. */
/* Structure for reentrant locale using functions. This is an
(almost) opaque type for the user level programs. */
@@ -347,10 +348,16 @@ struct random_data
int32_t *fptr; /* Front pointer. */
int32_t *rptr; /* Rear pointer. */
int32_t *state; /* Array of state values. */
+#if 0
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+#else
/* random_r.c, TYPE_x, DEG_x, SEP_x - small enough for int8_t */
int8_t rand_type; /* Type of random number generator. */
int8_t rand_deg; /* Degree of random number generator. */
int8_t rand_sep; /* Distance between front and rear. */
+#endif
int32_t *end_ptr; /* Pointer behind state table. */
};
@@ -540,7 +547,7 @@ extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
__BEGIN_NAMESPACE_STD
/* Call all functions registered with `atexit' and `on_exit',
- in the reverse of the order in which they were registered
+ in the reverse of the order in which they were registered,
perform stdio cleanup, and terminate program execution with STATUS. */
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
libc_hidden_proto(exit)
@@ -619,7 +626,7 @@ extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
Returns a file descriptor open on the file for reading and writing,
or -1 if it cannot create a uniquely-named file.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int mkstemp (char *__template) __nonnull ((1)) __wur;
@@ -636,7 +643,7 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
# endif
#endif
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_XOPEN2K8
/* Create a unique temporary directory from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the directory name unique.
@@ -662,14 +669,17 @@ extern char *canonicalize_file_name (__const char *__name)
__THROW __nonnull ((1)) __wur;
#endif
-/* Return the canonical absolute name of file NAME. If the
- canonical name is PATH_MAX chars or more, returns null
- with `errno' set to ENAMETOOLONG; if the name fits in
- fewer than PATH_MAX chars, returns the name in RESOLVED. */
-/* we choose to handle __resolved==NULL as crash :) */
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Return the canonical absolute name of file NAME. If RESOLVED is
+ null, the result is malloc'd; otherwise, if the canonical name is
+ PATH_MAX chars or more, returns null with `errno' set to
+ ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
+ returns the name in RESOLVED. */
extern char *realpath (__const char *__restrict __name,
char *__restrict __resolved) __THROW __wur;
libc_hidden_proto(realpath)
+#endif
+
/* Shorthand for type of comparison functions. */
#ifndef __COMPAR_FN_T
@@ -852,6 +862,7 @@ libc_hidden_proto(posix_openpt)
#ifdef __USE_XOPEN
/* The next four functions all take a master pseudo-tty fd and
perform an operation on the associated slave: */
+
#ifdef __UCLIBC_HAS_PTY__
/* Chown the slave to the calling user. */
extern int grantpt (int __fd) __THROW;
@@ -894,10 +905,16 @@ extern int getloadavg (double __loadavg[], int __nelem)
#include <stdint.h>
extern uint32_t arc4random(void);
extern void arc4random_stir(void);
-libc_hidden_proto(arc4random_stir)
extern void arc4random_addrandom(unsigned char *, int);
#endif
+#ifdef _LIBC
+extern int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer) attribute_hidden;
+
+/* Global state for non-reentrant functions. */
+extern struct drand48_data __libc_drand48_data attribute_hidden;
+#endif
+
#endif /* don't just need malloc and calloc */
#undef __need_malloc_and_calloc
diff --git a/include/string.h b/include/string.h
index ca22055ed..f11a7269c 100644
--- a/include/string.h
+++ b/include/string.h
@@ -124,7 +124,6 @@ libc_hidden_proto(strcoll)
extern size_t strxfrm (char *__restrict __dest,
__const char *__restrict __src, size_t __n)
__THROW __nonnull ((2));
-libc_hidden_proto(strxfrm)
__END_NAMESPACE_STD
#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
@@ -257,7 +256,6 @@ libc_hidden_proto(strcasestr)
extern void *memmem (__const void *__haystack, size_t __haystacklen,
__const void *__needle, size_t __needlelen)
__THROW __attribute_pure__ __nonnull ((1, 3));
-libc_hidden_proto(memmem)
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
last written byte. */
@@ -378,7 +376,7 @@ libc_hidden_proto(ffs)
/* The following two functions are non-standard but necessary for non-32 bit
platforms. */
-# if 0 /*#ifdef __USE_GNU*/
+#ifdef __USE_GNU
extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
# ifdef __GNUC__
__extension__ extern int ffsll (long long int __ll)
@@ -449,7 +447,6 @@ extern char *__stpncpy (char *__restrict __dest,
extern char *stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n)
__THROW __nonnull ((1, 2));
-libc_hidden_proto(stpncpy)
# if 0 /* uClibc does not support strfry or memfrob. */
/* Sautee STRING briskly. */
diff --git a/include/sys/wait.h b/include/sys/wait.h
index f283fe228..16893c0b9 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009
+ 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
@@ -51,7 +51,7 @@ __BEGIN_DECLS
# endif
/* This is the type of the argument to `wait'. The funky union
- causes redeclarations with ether `int *' or `union wait *' to be
+ causes redeclarations with either `int *' or `union wait *' to be
allowed without complaint. __WAIT_STATUS_DEFN is the type used in
the actual function definitions. */
@@ -79,22 +79,22 @@ typedef union
/* This will define all the `__W*' macros. */
# include <bits/waitstatus.h>
-# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
-# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
-# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
-# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
-# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
-# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
+# define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
+# define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
+# define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
+# define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
+# define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
# ifdef __WIFCONTINUED
-# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
# endif
#endif /* <stdlib.h> not included. */
#ifdef __USE_BSD
# define WCOREFLAG __WCOREFLAG
-# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
-# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
-# define W_STOPCODE(sig) __W_STOPCODE(sig)
+# define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE (sig)
#endif
/* The following values are used by the `waitid' function. */
@@ -172,10 +172,6 @@ extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
#endif
#ifdef __USE_BSD
-/* This being here makes the prototypes valid whether or not
- we have already included <sys/resource.h> to define `struct rusage'. */
-struct rusage;
-
/* PID is like waitpid. Other args are like wait3. */
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
struct rusage *__usage) __THROW;
diff --git a/include/time.h b/include/time.h
index 7fcdf68e6..65071a908 100644
--- a/include/time.h
+++ b/include/time.h
@@ -207,7 +207,6 @@ extern time_t mktime (struct tm *__tp) __THROW;
extern size_t strftime (char *__restrict __s, size_t __maxsize,
__const char *__restrict __format,
__const struct tm *__restrict __tp) __THROW;
-libc_hidden_proto(strftime)
__END_NAMESPACE_STD
# ifdef __USE_XOPEN
@@ -216,7 +215,6 @@ __END_NAMESPACE_STD
extern char *strptime (__const char *__restrict __s,
__const char *__restrict __fmt, struct tm *__tp)
__THROW;
-libc_hidden_proto(strptime)
# endif
#ifdef __UCLIBC_HAS_XLOCALE__
diff --git a/include/unistd.h b/include/unistd.h
index 5d3a4cb8f..c421cb308 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -51,9 +51,11 @@ __BEGIN_DECLS
Software Development Utilities Option. */
#define _POSIX2_SW_DEV 200112L
+#if 0 /* uClibc does not provide the utility */
/* If defined, the implementation supports the
creation of locales with the localedef utility. */
#define _POSIX2_LOCALEDEF 200112L
+#endif
/* X/Open version number to which the library conforms. It is selectable. */
#ifdef __USE_UNIX98
diff --git a/include/wchar-stub.h b/include/wchar-stub.h
index 0b0aa29aa..918c78dd4 100644
--- a/include/wchar-stub.h
+++ b/include/wchar-stub.h
@@ -7,7 +7,6 @@
#ifndef _WCHAR_H
#define _WCHAR_H
-#define MB_CUR_MAX 1
typedef unsigned int wint_t;
#define WEOF (0xffffffffu)
diff --git a/include/wchar.h b/include/wchar.h
index 3795998a5..3d477ba23 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -170,12 +170,10 @@ __END_NAMESPACE_C99
#ifdef __USE_GNU
/* Compare S1 and S2, ignoring case. */
extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
-libc_hidden_proto(wcscasecmp)
/* Compare no more than N chars of S1 and S2, ignoring case. */
extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
size_t __n) __THROW;
-libc_hidden_proto(wcsncasecmp)
#ifdef __UCLIBC_HAS_XLOCALE__
/* Similar to the two functions above but take the information from
@@ -202,7 +200,6 @@ libc_hidden_proto(wcscoll)
`wcscoll' to the original strings. */
extern size_t wcsxfrm (wchar_t *__restrict __s1,
__const wchar_t *__restrict __s2, size_t __n) __THROW;
-libc_hidden_proto(wcsxfrm)
__END_NAMESPACE_C99
#ifdef __USE_GNU
@@ -233,7 +230,6 @@ __BEGIN_NAMESPACE_C99
/* Find the first occurrence of WC in WCS. */
extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
__THROW __attribute_pure__;
-libc_hidden_proto(wcschr)
/* Find the last occurrence of WC in WCS. */
extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
__THROW __attribute_pure__;
@@ -244,7 +240,6 @@ __END_NAMESPACE_C99
the closing NUL wide character in case C is not found in S. */
extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
__THROW __attribute_pure__;
-libc_hidden_proto(wcschrnul)
#endif
__BEGIN_NAMESPACE_C99
@@ -549,7 +544,6 @@ extern int fwide (__FILE *__fp, int __mode) __THROW;
extern int fwprintf (__FILE *__restrict __stream,
__const wchar_t *__restrict __format, ...)
/* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
-libc_hidden_proto(fwprintf)
/* Write formatted output to stdout.
This function is a possible cancellation point and therefore not
@@ -762,7 +756,6 @@ __BEGIN_NAMESPACE_C99
extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
__const wchar_t *__restrict __format,
__const struct tm *__restrict __tp) __THROW;
-libc_hidden_proto(wcsftime)
__END_NAMESPACE_C99
# if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
@@ -788,6 +781,11 @@ libc_hidden_proto(wcsftime_l)
# include <wctype.h>
#endif
+#ifdef _LIBC
+extern size_t __wcslcpy(wchar_t *__restrict dst,
+ const wchar_t *__restrict src, size_t n) attribute_hidden;
+#endif
+
__END_DECLS
#endif /* _WCHAR_H defined */
diff --git a/include/wctype.h b/include/wctype.h
index 7b697d2b0..3ae682191 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -157,12 +157,13 @@ extern int iswpunct (wint_t __wc) __THROW;
set of wide characters for which none of `iswalnum', `iswgraph', or
`iswpunct' is true. */
extern int iswspace (wint_t __wc) __THROW;
+libc_hidden_proto(iswspace)
/* Test for any wide character that corresponds to an uppercase letter
or is one of a locale-specific set of wide character for which none
of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
extern int iswupper (wint_t __wc) __THROW;
-libc_hidden_proto(iswspace)
+libc_hidden_proto(iswupper)
/* Test for any wide character that corresponds to a hexadecimal-digit
character equivalent to that performed be the functions described
@@ -305,7 +306,6 @@ extern int iswblank_l (wint_t __wc, __locale_t __locale) __THROW;
by the string argument PROPERTY. */
extern wctype_t wctype_l (__const char *__property, __locale_t __locale)
__THROW;
-libc_hidden_proto(wctype_l)
/* Determine whether the wide-character WC has the property described by
DESC. */
diff --git a/include/xlocale.h b/include/xlocale.h
index 51a787f14..82dabdfda 100644
--- a/include/xlocale.h
+++ b/include/xlocale.h
@@ -1,5 +1,5 @@
/* Definition of locale datatype.
- Copyright (C) 1997,2000,02 Free Software Foundation, Inc.
+ Copyright (C) 1997,2000,2002,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,15 +21,6 @@
#ifndef _XLOCALE_H
#define _XLOCALE_H 1
-#include <features.h>
-
-#ifndef __UCLIBC_HAS_XLOCALE__
-#error Attempted to include xlocale.h when uClibc built without extended locale support.
-#endif
-
-#include <bits/uClibc_locale.h>
-/* #include <bits/uClibc_touplow.h> */
-
#if 0
/* Structure for reentrant locale using functions. This is an
(almost) opaque type for the user level programs. The file and
@@ -37,26 +28,22 @@
go away without warning. */
typedef struct __locale_struct
{
-#if 0
/* Note: LC_ALL is not a valid index into this array. */
struct locale_data *__locales[13]; /* 13 = __LC_LAST. */
-#endif
/* To increase the speed of this solution we add some special members. */
-/* const unsigned short int *__ctype_b; */
-/* const int *__ctype_tolower; */
-/* const int *__ctype_toupper; */
- const __uint16_t *__ctype_b;
- const __ctype_touplow_t *__ctype_tolower;
- const __ctype_touplow_t *__ctype_toupper;
-
- struct __uclibc_locale_struct *__locale_ptr;
+ const unsigned short int *__ctype_b;
+ const int *__ctype_tolower;
+ const int *__ctype_toupper;
-#if 0
/* Note: LC_ALL is not a valid index into this array. */
const char *__names[13];
-#endif
} *__locale_t;
+
+/* POSIX 2008 makes locale_t official. */
+typedef __locale_t locale_t;
+#else
+# include <locale.h>
#endif
#endif /* xlocale.h */