summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/a.out.h6
-rw-r--r--include/alloca.h33
-rw-r--r--include/arpa/inet.h6
-rw-r--r--include/arpa/nameser.h2
-rw-r--r--include/arpa/nameser_compat.h4
-rw-r--r--include/assert.h8
-rw-r--r--include/ctype.h33
-rw-r--r--include/elf.h8
-rw-r--r--include/features.h148
-rw-r--r--include/ieee754.h8
-rw-r--r--include/inttypes.h148
-rw-r--r--include/langinfo.h48
-rw-r--r--include/libc-internal.h38
-rw-r--r--include/limits.h23
-rw-r--r--include/locale.h10
-rw-r--r--include/math.h2
-rw-r--r--include/net/ethernet.h10
-rw-r--r--include/net/if_arp.h10
-rw-r--r--include/netinet/ether.h4
-rw-r--r--include/netinet/icmp6.h12
-rw-r--r--include/netinet/in.h41
-rw-r--r--include/netinet/ip6.h8
-rw-r--r--include/netinet/protocols.h62
-rw-r--r--include/nl_types.h2
-rw-r--r--include/paths.h1
-rw-r--r--include/regexp.h20
-rw-r--r--include/rpc/auth.h4
-rw-r--r--include/rpc/auth_des.h4
-rw-r--r--include/signal.h2
-rw-r--r--include/stdlib.h30
-rw-r--r--include/sys/mman.h6
-rw-r--r--include/sys/msg.h10
-rw-r--r--include/sys/poll.h2
-rw-r--r--include/sys/shm.h3
-rw-r--r--include/sys/socket.h9
-rw-r--r--include/sys/stat.h1
-rw-r--r--include/sys/statvfs.h8
-rw-r--r--include/sys/syscall.h10
-rw-r--r--include/sys/timex.h2
-rw-r--r--include/sys/utsname.h23
-rw-r--r--include/sys/wait.h2
-rw-r--r--include/utmp.h2
-rw-r--r--include/values.h2
43 files changed, 488 insertions, 327 deletions
diff --git a/include/a.out.h b/include/a.out.h
index d963de74c..027c49ad5 100644
--- a/include/a.out.h
+++ b/include/a.out.h
@@ -1,5 +1 @@
-#ifdef _LIBC
-# include_next <linux/a.out.h>
-#else
-# include <linux/a.out.h>
-#endif
+#include <linux/a.out.h>
diff --git a/include/alloca.h b/include/alloca.h
index b4fc31738..2565b4835 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -36,7 +36,38 @@ extern void *alloca (size_t __size) __THROW;
# define alloca(size) __builtin_alloca (size)
#endif /* GCC. */
-#define __MAX_ALLOCA_CUTOFF 65536
+#ifdef _LIBC
+# define __MAX_ALLOCA_CUTOFF 65536
+
+# include <bits/stackinfo.h>
+# ifdef _STACK_GROWS_DOWN
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = (newlen); \
+ char *__newbuf = alloca (__newlen); \
+ if (__newbuf + __newlen == (char *) buf) \
+ len += __newlen; \
+ else \
+ len = __newlen; \
+ __newbuf; })
+# elif defined _STACK_GROWS_UP
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = (newlen); \
+ char *__newbuf = alloca (__newlen); \
+ char *__buf = (buf); \
+ if (__buf + __newlen == __newbuf) \
+ { \
+ len += __newlen; \
+ __newbuf = __buf; \
+ } \
+ else \
+ len = __newlen; \
+ __newbuf; })
+# else
+# error unknown stack
+# define extend_alloca(buf, len, newlen) \
+ alloca (((len) = (newlen)))
+# endif
+#endif
__END_DECLS
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 8ecad55f0..fbd715af0 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001, 2004 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
@@ -57,9 +57,11 @@ libc_hidden_proto(inet_network)
is a pointer to an internal array containing the string. */
extern char *inet_ntoa (struct in_addr __in) __THROW;
libc_hidden_proto(inet_ntoa)
+#ifdef __UCLIBC__
/* Recursion-safe flavor */
extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW;
libc_hidden_proto(inet_ntoa_r)
+#endif
/* Convert from presentation format of an Internet number in buffer
starting at CP to the binary network format and store result for
@@ -84,6 +86,7 @@ libc_hidden_proto(inet_ntop)
extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
libc_hidden_proto(inet_aton)
+#if 0
/* Format a network number NET into presentation format and place result
in buffer starting at BUF with length of LEN bytes. */
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
@@ -111,6 +114,7 @@ extern unsigned int inet_nsap_addr (__const char *__cp,
extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
char *__buf) __THROW;
#endif
+#endif
__END_DECLS
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index a9c199e25..917ba19b9 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -287,7 +287,7 @@ typedef enum __ns_type {
ns_t_naptr = 35, /* Naming Authority PoinTeR */
ns_t_kx = 36, /* Key Exchange */
ns_t_cert = 37, /* Certification record */
- ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
+ ns_t_a6 = 38, /* IPv6 address (deprecated, use ns_t_aaaa) */
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h
index e3ef864cd..7fe46a16d 100644
--- a/include/arpa/nameser_compat.h
+++ b/include/arpa/nameser_compat.h
@@ -47,7 +47,7 @@
typedef struct {
unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */
@@ -61,7 +61,7 @@ typedef struct {
unsigned cd: 1; /* checking disabled by resolver */
unsigned rcode :4; /* response code */
#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
diff --git a/include/assert.h b/include/assert.h
index 439179d8d..40b16059b 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -51,15 +51,15 @@
__BEGIN_DECLS
/* This prints an "Assertion failed" message and aborts. */
-extern void __assert __P((const char *, const char *, int, const char *));
+extern void __assert(const char *, const char *, unsigned int, const char *)
+ __THROW __attribute__ ((__noreturn__));
libc_hidden_proto(__assert)
__END_DECLS
# define assert(expr) \
- (__ASSERT_VOID_CAST ((expr) ? 0 : \
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
+ (__ASSERT_VOID_CAST ((expr) ? 0 : \
+ (__assert (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
which contains the name of the function currently being defined.
diff --git a/include/ctype.h b/include/ctype.h
index da73a44fc..dcfeb1b3e 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -66,7 +66,8 @@ libc_hidden_proto(tolower)
extern int toupper(int __c) __THROW;
libc_hidden_proto(toupper)
-#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+#if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) && \
+ defined __UCLIBC_SUSV4_LEGACY__
/* Return nonzero iff C is in the ASCII set
(i.e., is no more than 7 bits wide). */
extern int isascii(int __c) __THROW;
@@ -203,11 +204,12 @@ libc_hidden_proto(__ctype_tolower)
#endif /* __UCLIBC_HAS_XLOCALE__ */
-
+#ifdef __UCLIBC_SUSV4_LEGACY__
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
+#endif
-#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+#ifdef _LIBC
/* These are uClibc-specific. */
#define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9)
#define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9)
@@ -278,13 +280,12 @@ __NTH (toupper (int __c))
# define toupper(c) __tobody(c, toupper, __UCLIBC_CTYPE_TOUPPER, (c))
# endif /* Optimizing gcc */
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
# define isascii(c) __isascii (c)
# define toascii(c) __toascii (c)
-# if __UCLIBC_SUSV4_LEGACY__
-# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)])
-# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
-# endif
+# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)])
+# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
# endif
#endif /* not __cplusplus */
@@ -334,8 +335,8 @@ libc_hidden_proto(isxdigit_l)
extern int isblank_l(int, __locale_t) __THROW;
libc_hidden_proto(isblank_l)
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
-
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
/* Return nonzero iff C is in the ASCII set
(i.e., is no more than 7 bits wide). */
extern int isascii_l (int __c) __THROW;
@@ -378,7 +379,8 @@ libc_hidden_proto(toupper_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
+# 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
@@ -396,7 +398,8 @@ libc_hidden_proto(toupper_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
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
# define isascii_l(c,l) __isascii_l ((c), (l))
# define toascii_l(c,l) __toascii_l ((c), (l))
# endif
@@ -409,4 +412,10 @@ __END_DECLS
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
+/* We define {__,}isascii for internal use only */
+#if defined _LIBC && !defined __UCLIBC_SUSV4_LEGACY__
+# define __isascii(c) (((c) & ~0x7f) == 0)
+# define isascii(c) __isascii (c)
+#endif
+
#endif /* ctype.h */
diff --git a/include/elf.h b/include/elf.h
index 0da4bf7a7..b86aa52be 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -2180,10 +2180,10 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
/* GNU relocs used in PIC code sequences. */
-#define R_PPC_REL16 249 /* word32 (sym-.) */
-#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */
-#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */
-#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */
+#define R_PPC_REL16 249 /* word32 (sym+add-.) */
+#define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */
+#define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */
+#define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */
/* This is a phony reloc to handle any old fashioned TOC16 references
that may still be in object files. */
diff --git a/include/features.h b/include/features.h
index 66447e2ed..1d47b5660 100644
--- a/include/features.h
+++ b/include/features.h
@@ -19,35 +19,6 @@
#ifndef _FEATURES_H
#define _FEATURES_H 1
-/* This macro indicates that the installed library is uClibc. Use
- * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
- * specific releases. */
-#define __UCLIBC__ 1
-
-/* Load up the current set of uClibc supported features along
- * with the current uClibc major and minor version numbers.
- * For uClibc release 0.9.26, these numbers would be:
- * #define __UCLIBC_MAJOR__ 0
- * #define __UCLIBC_MINOR__ 9
- * #define __UCLIBC_SUBLEVEL__ 26
- */
-#define __need_uClibc_config_h
-#include <bits/uClibc_config.h>
-#undef __need_uClibc_config_h
-#ifdef _LIBC
-#include <bits/uClibc_arch_features.h>
-#endif
-
-/* For uClibc, always optimize for size -- this should disable
- * a lot of expensive inlining...
- * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of
- * gcc -Os compile. We should not mess with compiler inlines.
- * We should instead disable __USE_EXTERN_INLINES unconditionally,
- * or maybe actually audit and test uclibc to work correctly
- * with __USE_EXTERN_INLINES on.
- */
-#define __OPTIMIZE_SIZE__ 1
-
/* These are defined by the user (or the compiler)
to specify the desired environment:
@@ -189,10 +160,8 @@
# define _XOPEN_SOURCE 700
# undef _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED 1
-# ifdef __UCLIBC_HAS_LFS__
-# undef _LARGEFILE64_SOURCE
-# define _LARGEFILE64_SOURCE 1
-# endif /* __UCLIBC_HAS_LFS__ */
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
# undef _BSD_SOURCE
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
@@ -201,6 +170,57 @@
# define _ATFILE_SOURCE 1
#endif
+/* This macro indicates that the installed library is uClibc. Use
+ * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
+ * specific releases. */
+#define __UCLIBC__ 1
+
+#ifdef __UCLIBC__
+/* Load up the current set of uClibc supported features along
+ * with the current uClibc major and minor version numbers.
+ * For uClibc release 0.9.26, these numbers would be:
+ * #define __UCLIBC_MAJOR__ 0
+ * #define __UCLIBC_MINOR__ 9
+ * #define __UCLIBC_SUBLEVEL__ 26
+ */
+# define __need_uClibc_config_h
+# include <bits/uClibc_config.h>
+# undef __need_uClibc_config_h
+
+/* For uClibc, always optimize for size -- this should disable
+ * a lot of expensive inlining...
+ * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of
+ * gcc -Os compile. We should not mess with compiler inlines.
+ * We should instead disable __USE_EXTERN_INLINES unconditionally,
+ * or maybe actually audit and test uclibc to work correctly
+ * with __USE_EXTERN_INLINES on.
+ */
+# define __OPTIMIZE_SIZE__ 1
+
+/* disable unsupported features */
+# undef _FORTIFY_SOURCE
+# undef __LDBL_COMPAT
+
+# ifndef __UCLIBC_HAS_THREADS__
+# if defined _REENTRANT || defined _THREAD_SAFE
+# warning requested reentrant code, but thread support was disabled
+# undef _REENTRANT
+# undef _THREAD_SAFE
+# endif
+# endif
+
+# ifndef __UCLIBC_HAS_LFS__
+# undef _LARGEFILE64_SOURCE
+/* NOTE: This is probably incorrect on a 64-bit arch... */
+# if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
+uClibc was built without large file support enabled.
+# endif
+# elif defined __BCC__
+# error BCC does not support LFS, please disable it
+# endif
+#endif /* __UCLIBC__ */
+
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
@@ -329,8 +349,6 @@
# define __USE_REENTRANT 1
#endif
-/* uClibc does not support _FORTIFY_SOURCE */
-#undef _FORTIFY_SOURCE
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
&& __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE > 1
@@ -343,8 +361,10 @@
#endif
/* We do support the IEC 559 math functionality, real and complex. */
+#ifdef __UCLIBC_HAS_FLOATS__
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
+#endif
#ifdef __UCLIBC_HAS_WCHAR__
/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
@@ -362,14 +382,16 @@
/* This macro indicates that the installed library is the GNU C Library.
For historic reasons the value now is 6 and this will stay from now
on. The use of this variable is deprecated. */
-# undef __GNU_LIBRARY__
-# define __GNU_LIBRARY__ 6
+/* uClibc WARNING: leave these aligned to the left, don't put a space after '#', else
+ * broken apps could fail the check. */
+#undef __GNU_LIBRARY__
+#define __GNU_LIBRARY__ 6
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
/* Don't do it, if you want to keep uClibc happy. */
-# define __GLIBC__ 2
-# define __GLIBC_MINOR__ 2
+#define __GLIBC__ 2
+#define __GLIBC_MINOR__ 2
#endif
#define __GLIBC_PREREQ(maj, min) \
@@ -395,7 +417,9 @@
__USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
# define __USE_LARGEFILE 1
+# ifdef __UCLIBC_HAS_LFS__
# define __USE_LARGEFILE64 1
+# endif
# endif
#endif /* !ASSEMBLER */
@@ -413,50 +437,12 @@
# define __USE_EXTERN_INLINES 1
#endif
-
-/* Make sure users large file options agree with uClibc's configuration. */
-#ifndef __UCLIBC_HAS_LFS__
-
-/* If uClibc was built without large file support, output an error if
- * 64-bit file offsets were requested.
- * NOTE: This is probably incorrect on a 64-bit arch... */
-# ifdef __USE_FILE_OFFSET64
-# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
-uClibc was built without large file support enabled.
-# endif
-
-/* If uClibc was built without large file support and _LARGEFILE64_SOURCE
- * is defined, undefine it. */
-# ifdef _LARGEFILE64_SOURCE
-# undef _LARGEFILE64_SOURCE
-# undef __USE_LARGEFILE64
-# endif
-
-/* If we're actually building uClibc with large file support,
- * define __USE_LARGEFILE64 and __USE_LARGEFILE. */
-#elif defined _LIBC
-# undef _LARGEFILE_SOURCE
-# undef _LARGEFILE64_SOURCE
-# undef _FILE_OFFSET_BITS
-# undef __USE_LARGEFILE
-# undef __USE_LARGEFILE64
-# undef __USE_FILE_OFFSET64
-# define _LARGEFILE_SOURCE 1
-# define _LARGEFILE64_SOURCE 1
-# define __USE_LARGEFILE 1
-# define __USE_LARGEFILE64 1
-#endif
-
#ifdef _LIBC
+# ifdef __UCLIBC_HAS_LFS__
+# undef _FILE_OFFSET_BITS
+# undef __USE_FILE_OFFSET64
+# endif
# include <libc-internal.h>
#endif
-/* Some people like to build up uClibc with *-elf toolchains, so
- * a little grease here until we drop '#ifdef __linux__' checks
- * from our source code.
- */
-#ifndef __linux__
-# define __linux__ 1
-#endif
-
#endif /* features.h */
diff --git a/include/ieee754.h b/include/ieee754.h
index 7131e5de6..b17c29ab7 100644
--- a/include/ieee754.h
+++ b/include/ieee754.h
@@ -80,7 +80,7 @@ union ieee754_double
unsigned int mantissa1:32;
#endif /* Big endian. */
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int mantissa0:20;
unsigned int exponent:11;
unsigned int negative:1;
@@ -106,7 +106,7 @@ union ieee754_double
unsigned int mantissa0:19;
unsigned int mantissa1:32;
#else
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int mantissa0:19;
unsigned int quiet_nan:1;
unsigned int exponent:11;
@@ -142,7 +142,7 @@ union ieee854_long_double
unsigned int mantissa1:32;
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int exponent:15;
unsigned int negative:1;
unsigned int empty:16;
@@ -171,7 +171,7 @@ union ieee854_long_double
unsigned int mantissa1:32;
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int exponent:15;
unsigned int negative:1;
unsigned int empty:16;
diff --git a/include/inttypes.h b/include/inttypes.h
index b1d4302a2..137d3dbd4 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2001, 2004, 2007 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
@@ -70,8 +70,8 @@ typedef wchar_t __gwchar_t;
# define PRIdLEAST64 __PRI64_PREFIX "d"
# define PRIdFAST8 "d"
-# define PRIdFAST16 "d"
-# define PRIdFAST32 "d"
+# define PRIdFAST16 __PRIPTR_PREFIX "d"
+# define PRIdFAST32 __PRIPTR_PREFIX "d"
# define PRIdFAST64 __PRI64_PREFIX "d"
@@ -86,8 +86,8 @@ typedef wchar_t __gwchar_t;
# define PRIiLEAST64 __PRI64_PREFIX "i"
# define PRIiFAST8 "i"
-# define PRIiFAST16 "i"
-# define PRIiFAST32 "i"
+# define PRIiFAST16 __PRIPTR_PREFIX "i"
+# define PRIiFAST32 __PRIPTR_PREFIX "i"
# define PRIiFAST64 __PRI64_PREFIX "i"
/* Octal notation. */
@@ -102,8 +102,8 @@ typedef wchar_t __gwchar_t;
# define PRIoLEAST64 __PRI64_PREFIX "o"
# define PRIoFAST8 "o"
-# define PRIoFAST16 "o"
-# define PRIoFAST32 "o"
+# define PRIoFAST16 __PRIPTR_PREFIX "o"
+# define PRIoFAST32 __PRIPTR_PREFIX "o"
# define PRIoFAST64 __PRI64_PREFIX "o"
/* Unsigned integers. */
@@ -118,8 +118,8 @@ typedef wchar_t __gwchar_t;
# define PRIuLEAST64 __PRI64_PREFIX "u"
# define PRIuFAST8 "u"
-# define PRIuFAST16 "u"
-# define PRIuFAST32 "u"
+# define PRIuFAST16 __PRIPTR_PREFIX "u"
+# define PRIuFAST32 __PRIPTR_PREFIX "u"
# define PRIuFAST64 __PRI64_PREFIX "u"
/* lowercase hexadecimal notation. */
@@ -134,8 +134,8 @@ typedef wchar_t __gwchar_t;
# define PRIxLEAST64 __PRI64_PREFIX "x"
# define PRIxFAST8 "x"
-# define PRIxFAST16 "x"
-# define PRIxFAST32 "x"
+# define PRIxFAST16 __PRIPTR_PREFIX "x"
+# define PRIxFAST32 __PRIPTR_PREFIX "x"
# define PRIxFAST64 __PRI64_PREFIX "x"
/* UPPERCASE hexadecimal notation. */
@@ -150,8 +150,8 @@ typedef wchar_t __gwchar_t;
# define PRIXLEAST64 __PRI64_PREFIX "X"
# define PRIXFAST8 "X"
-# define PRIXFAST16 "X"
-# define PRIXFAST32 "X"
+# define PRIXFAST16 __PRIPTR_PREFIX "X"
+# define PRIXFAST32 __PRIPTR_PREFIX "X"
# define PRIXFAST64 __PRI64_PREFIX "X"
@@ -311,7 +311,7 @@ extern intmax_t strtoimax (__const char *__restrict __nptr,
extern uintmax_t strtoumax (__const char *__restrict __nptr,
char ** __restrict __endptr, int __base) __THROW;
-#if defined __UCLIBC_HAS_WCHAR__ && __UCLIBC_HAS_WCHAR__
+#ifdef __UCLIBC_HAS_WCHAR__
/* Like `wcstol' but convert to `intmax_t'. */
extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr,
__gwchar_t **__restrict __endptr, int __base)
@@ -323,6 +323,126 @@ extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr,
__THROW;
#endif
+#if 0 /*def __USE_EXTERN_INLINES*/
+
+# if __WORDSIZE == 64
+
+extern long int __strtol_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __strtoul_internal (__const char *
+ __restrict __nptr,
+ char ** __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoul_internal (nptr, endptr, base, 0);
+}
+
+extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __wcstoul_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoul_internal (nptr, endptr, base, 0);
+}
+
+# else /* __WORDSIZE == 32 */
+
+__extension__
+extern long long int __strtoll_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoll_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern unsigned long long int __strtoull_internal (__const char *
+ __restrict __nptr,
+ char **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoull_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern long long int __wcstoll_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoll_internal (nptr, endptr, base, 0);
+}
+
+
+__extension__
+extern unsigned long long int __wcstoull_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoull_internal (nptr, endptr, base, 0);
+}
+
+# endif /* __WORDSIZE == 32 */
+#endif /* Use extern inlines. */
+
__END_DECLS
#endif /* inttypes.h */
diff --git a/include/langinfo.h b/include/langinfo.h
index f289a66c0..2e2ee4ec8 100644
--- a/include/langinfo.h
+++ b/include/langinfo.h
@@ -1,5 +1,5 @@
/* Access to locale-dependent parameters.
- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002,2003,2004,2005 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
@@ -32,13 +32,20 @@ __BEGIN_DECLS
(LC_*) and an item index within the category. Some code may depend on
the item values within a category increasing monotonically with the
indices. */
+#if 0
+#define _NL_ITEM(category, index) (((category) << 16) | (index))
+
+/* Extract the category and item index from a constructed `nl_item' value. */
+#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
+#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
+#else
#define _NL_ITEM(category, index) \
(((category) << __NL_ITEM_CATEGORY_SHIFT) | (index))
/* Extract the category and item index from a constructed `nl_item' value. */
#define _NL_ITEM_CATEGORY(item) ((int) (item) >> __NL_ITEM_CATEGORY_SHIFT)
#define _NL_ITEM_INDEX(item) ((int) (item) & __NL_ITEM_INDEX_MASK)
-
+#endif
/* Enumeration of locale items that can be queried with `nl_langinfo'. */
enum
@@ -312,6 +319,9 @@ enum
_NL_CTYPE_INDIGITS8_WC,
_NL_CTYPE_INDIGITS9_WC,
_NL_CTYPE_OUTDIGIT0_MB,
+#else
+ _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0),
+#endif
_NL_CTYPE_OUTDIGIT1_MB,
_NL_CTYPE_OUTDIGIT2_MB,
_NL_CTYPE_OUTDIGIT3_MB,
@@ -321,6 +331,7 @@ enum
_NL_CTYPE_OUTDIGIT7_MB,
_NL_CTYPE_OUTDIGIT8_MB,
_NL_CTYPE_OUTDIGIT9_MB,
+#if 0
_NL_CTYPE_OUTDIGIT0_WC,
_NL_CTYPE_OUTDIGIT1_WC,
_NL_CTYPE_OUTDIGIT2_WC,
@@ -340,6 +351,7 @@ enum
_NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
_NL_CTYPE_TRANSLIT_IGNORE_LEN,
_NL_CTYPE_TRANSLIT_IGNORE,
+ _NL_CTYPE_MAP_TO_NONASCII,
_NL_CTYPE_EXTRA_MAP_1,
_NL_CTYPE_EXTRA_MAP_2,
_NL_CTYPE_EXTRA_MAP_3,
@@ -354,17 +366,7 @@ enum
_NL_CTYPE_EXTRA_MAP_12,
_NL_CTYPE_EXTRA_MAP_13,
_NL_CTYPE_EXTRA_MAP_14,
-#else /* 0 */
- _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0),
- _NL_CTYPE_OUTDIGIT1_MB,
- _NL_CTYPE_OUTDIGIT2_MB,
- _NL_CTYPE_OUTDIGIT3_MB,
- _NL_CTYPE_OUTDIGIT4_MB,
- _NL_CTYPE_OUTDIGIT5_MB,
- _NL_CTYPE_OUTDIGIT6_MB,
- _NL_CTYPE_OUTDIGIT7_MB,
- _NL_CTYPE_OUTDIGIT8_MB,
- _NL_CTYPE_OUTDIGIT9_MB,
+#else /* 0 */
_NL_CTYPE_CODESET_NAME, /* uClibc note: MUST BE LAST ENTRY!!! */
CODESET = _NL_CTYPE_CODESET_NAME,
#define CODESET CODESET
@@ -434,6 +436,10 @@ enum
#ifdef __USE_GNU
# define N_SIGN_POSN __N_SIGN_POSN
#endif
+#if 0 /* moved below for some reason on uClibc */
+ _NL_MONETARY_CRNCYSTR,
+#define CRNCYSTR _NL_MONETARY_CRNCYSTR
+#endif
__INT_P_CS_PRECEDES,
#ifdef __USE_GNU
# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
@@ -458,10 +464,10 @@ enum
#ifdef __USE_GNU
# define INT_N_SIGN_POSN __INT_N_SIGN_POSN
#endif
-
+#if 1 /* moved here from above */
_NL_MONETARY_CRNCYSTR,
#define CRNCYSTR _NL_MONETARY_CRNCYSTR
-
+#endif
#if 0
_NL_MONETARY_DUO_INT_CURR_SYMBOL,
_NL_MONETARY_DUO_CURRENCY_SYMBOL,
@@ -591,10 +597,18 @@ enum
_NL_IDENTIFICATION_CODESET,
_NL_NUM_LC_IDENTIFICATION,
#endif
+
/* This marks the highest value used. */
_NL_NUM
};
+/* This macro produces an item you can pass to `nl_langinfo' or
+ `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */
+#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1)
+#ifdef __USE_GNU
+# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category)
+#endif
+
/* Return the current locale's value for ITEM.
If ITEM is invalid, an empty string is returned.
@@ -606,8 +620,7 @@ extern char *nl_langinfo (nl_item __item) __THROW;
libc_hidden_proto(nl_langinfo)
-#ifdef __UCLIBC_HAS_XLOCALE__
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
/* This interface is for the extended locale model. See <locale.h> for
more information. */
@@ -618,7 +631,6 @@ libc_hidden_proto(nl_langinfo)
extern char *nl_langinfo_l (nl_item __item, __locale_t l);
libc_hidden_proto(nl_langinfo_l)
#endif
-#endif
__END_DECLS
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 33956d8b1..443b1fc50 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -67,36 +67,14 @@ extern const char *__uclibc_progname attribute_hidden;
# endif /* IS_IN_libc */
-/* #include <alloca.h> */
-#include <bits/stackinfo.h>
-#if defined(_STACK_GROWS_DOWN)
-# define extend_alloca(buf, len, newlen) \
- (__typeof (buf)) ({ size_t __newlen = (newlen); \
- char *__newbuf = alloca (__newlen); \
- if (__newbuf + __newlen == (char *) buf) \
- len += __newlen; \
- else \
- len = __newlen; \
- __newbuf; })
-#elif defined(_STACK_GROWS_UP)
-# define extend_alloca(buf, len, newlen) \
- (__typeof (buf)) ({ size_t __newlen = (newlen); \
- char *__newbuf = alloca (__newlen); \
- char *__buf = (buf); \
- if (__buf + __newlen == __newbuf) \
- { \
- len += __newlen; \
- __newbuf = __buf; \
- } \
- else \
- len = __newlen; \
- __newbuf; })
-#else
-# warning unknown stack
-# define extend_alloca(buf, len, newlen) \
- alloca (((len) = (newlen)))
-#endif
-
#endif /* __ASSEMBLER__ */
+/* Some people like to build up uClibc with *-elf toolchains, so
+ * a little grease here until we drop '#ifdef __linux__' checks
+ * from our source code.
+ */
+#ifndef __linux__
+# define __linux__ 1
+#endif
+
#endif /* _LIBC_INTERNAL_H */
diff --git a/include/limits.h b/include/limits.h
index 45cd6f253..3e9a5df88 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2005
+ 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
@@ -122,20 +123,20 @@
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
# include_next <limits.h>
+#endif
/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
ages are available. */
-# ifdef __USE_ISOC99
-# ifndef LLONG_MIN
-# define LLONG_MIN LONG_LONG_MIN
-# endif
-# ifndef LLONG_MAX
-# define LLONG_MAX LONG_LONG_MAX
-# endif
-# ifndef ULLONG_MAX
-# define ULLONG_MAX ULONG_LONG_MAX
-# endif
+#if defined __USE_ISOC99 && defined __GNUC__
+# ifndef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX-1)
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+# endif
+# ifndef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
# endif
#endif
diff --git a/include/locale.h b/include/locale.h
index cdb3a09d9..b740908f0 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -39,6 +39,7 @@ __BEGIN_DECLS
#define LC_COLLATE __LC_COLLATE
#define LC_MONETARY __LC_MONETARY
#define LC_MESSAGES __LC_MESSAGES
+#define LC_ALL __LC_ALL
#if 0
#define LC_PAPER __LC_PAPER
#define LC_NAME __LC_NAME
@@ -47,9 +48,10 @@ __BEGIN_DECLS
#define LC_MEASUREMENT __LC_MEASUREMENT
#define LC_IDENTIFICATION __LC_IDENTIFICATION
#endif
-#define LC_ALL __LC_ALL
+__BEGIN_NAMESPACE_STD
+
/* Structure giving information about numeric and monetary notation. */
struct lconv
{
@@ -121,8 +123,6 @@ struct lconv
};
-__BEGIN_NAMESPACE_STD
-
/* Set and/or return the current locale. */
extern char *setlocale (int __category, __const char *__locale) __THROW;
@@ -133,7 +133,7 @@ libc_hidden_proto(localeconv)
__END_NAMESPACE_STD
-#if defined(__USE_GNU) && defined(__UCLIBC_HAS_LOCALE__)
+#if defined __USE_GNU && 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
@@ -145,7 +145,7 @@ __END_NAMESPACE_STD
Attention: all these functions are *not* standardized in any form.
This is a proof-of-concept implementation. */
-#if defined(__UCLIBC_HAS_XLOCALE__)
+#ifdef __UCLIBC_HAS_XLOCALE__
/* Get locale datatype definition. */
# include <xlocale.h>
#endif
diff --git a/include/math.h b/include/math.h
index ecd01877c..83ed8993c 100644
--- a/include/math.h
+++ b/include/math.h
@@ -377,8 +377,10 @@ extern int matherr (struct exception *__exc);
#else /* !SVID */
# ifdef __USE_XOPEN
+# ifdef __UCLIBC_SUSV4_LEGACY__
/* X/Open wants another strange constant. */
# define MAXFLOAT 3.40282347e+38F
+# endif
# endif
#endif /* SVID */
diff --git a/include/net/ethernet.h b/include/net/ethernet.h
index 7ca8e8348..0242d5899 100644
--- a/include/net/ethernet.h
+++ b/include/net/ethernet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2001, 2008 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
@@ -45,9 +45,17 @@ struct ether_header
/* Ethernet protocol ID's */
#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
+#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
#define ETHERTYPE_IP 0x0800 /* IP */
#define ETHERTYPE_ARP 0x0806 /* Address resolution */
#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
+#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
+#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
+#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
+#define ETHERTYPE_IPX 0x8137 /* IPX */
+#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
+#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
+
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
#define ETHER_TYPE_LEN 2 /* bytes in type field */
diff --git a/include/net/if_arp.h b/include/net/if_arp.h
index 46f035bef..9608652ee 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 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -96,7 +96,7 @@ struct arphdr
#define ARPHRD_ADAPT 264
#define ARPHRD_ROSE 270
#define ARPHRD_X25 271 /* CCITT X.25. */
-#define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */
+#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
#define ARPHRD_PPP 512
#define ARPHRD_CISCO 513 /* Cisco HDLC. */
#define ARPHRD_HDLC ARPHRD_CISCO
@@ -126,6 +126,12 @@ struct arphdr
#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
#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_VOID 0xFFFF /* Void type, nothing is known. */
+#define ARPHRD_NONE 0xFFFE /* Zero header length. */
+
/* ARP ioctl request. */
struct arpreq
diff --git a/include/netinet/ether.h b/include/netinet/ether.h
index 3d8902f50..5e89dfe9e 100644
--- a/include/netinet/ether.h
+++ b/include/netinet/ether.h
@@ -25,7 +25,9 @@
/* Get definition of `struct ether_addr'. */
#include <netinet/if_ether.h>
+#ifdef _LIBC
#define ETHER_FILE_NAME "/etc/ethers"
+#endif
__BEGIN_DECLS
@@ -41,6 +43,7 @@ extern struct ether_addr *ether_aton_r (__const char *__asc,
struct ether_addr *__addr) __THROW;
libc_hidden_proto(ether_aton_r)
+#if 0
/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr)
__THROW;
@@ -52,6 +55,7 @@ extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr)
/* Scan LINE and set ADDR and HOSTNAME. */
extern int ether_line (__const char *__line, struct ether_addr *__addr,
char *__hostname) __THROW;
+#endif
__END_DECLS
diff --git a/include/netinet/icmp6.h b/include/netinet/icmp6.h
index 0cb1aa6a6..225e49e07 100644
--- a/include/netinet/icmp6.h
+++ b/include/netinet/icmp6.h
@@ -161,11 +161,11 @@ struct nd_neighbor_advert /* neighbor advertisement */
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
#define ND_NA_FLAG_ROUTER 0x80000000
#define ND_NA_FLAG_SOLICITED 0x40000000
#define ND_NA_FLAG_OVERRIDE 0x20000000
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
#define ND_NA_FLAG_OVERRIDE 0x00000020
@@ -299,10 +299,10 @@ struct rr_pco_use /* use prefix part */
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
#endif
@@ -316,10 +316,10 @@ struct rr_result /* router renumbering result message */
struct in6_addr rrr_prefix;
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
#endif
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 851aace59..06965d65b 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007
+/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -53,6 +53,8 @@ enum
#define IPPROTO_IDP IPPROTO_IDP
IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */
#define IPPROTO_TP IPPROTO_TP
+ IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */
+#define IPPROTO_DCCP IPPROTO_DCCP
IPPROTO_IPV6 = 41, /* IPv6 header. */
#define IPPROTO_IPV6 IPPROTO_IPV6
IPPROTO_ROUTING = 43, /* IPv6 routing header. */
@@ -83,6 +85,8 @@ enum
#define IPPROTO_COMP IPPROTO_COMP
IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */
#define IPPROTO_SCTP IPPROTO_SCTP
+ IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */
+#define IPPROTO_UDPLITE IPPROTO_UDPLITE
IPPROTO_RAW = 255, /* Raw IP packets. */
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MAX
@@ -195,13 +199,17 @@ struct in6_addr
{
union
{
- uint8_t u6_addr8[16];
- uint16_t u6_addr16[8];
- uint32_t u6_addr32[4];
- } in6_u;
-#define s6_addr in6_u.u6_addr8
-#define s6_addr16 in6_u.u6_addr16
-#define s6_addr32 in6_u.u6_addr32
+ uint8_t __u6_addr8[16];
+#if defined __USE_MISC || defined __USE_GNU
+ uint16_t __u6_addr16[8];
+ uint32_t __u6_addr32[4];
+#endif
+ } __in6_u;
+#define s6_addr __in6_u.__u6_addr8
+#if defined __USE_MISC || defined __USE_GNU
+# define s6_addr16 __in6_u.__u6_addr16
+# define s6_addr32 __in6_u.__u6_addr32
+#endif
};
extern const struct in6_addr in6addr_any; /* :: */
@@ -213,11 +221,8 @@ libc_hidden_proto(in6addr_loopback)
#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46
-/* Get the definition of the macro to define the common sockaddr members. */
-#include <bits/socket.h>
-
-#if 1 /* defined __UCLIBC_HAS_IPV4__ */
+#if 1 /*def __UCLIBC_HAS_IPV4__*/
/* Structure describing an Internet socket address. */
struct sockaddr_in
{
@@ -244,6 +249,7 @@ struct sockaddr_in6
};
+#if defined __USE_MISC || defined __USE_GNU
/* IPv4 multicast request. */
struct ip_mreq
{
@@ -265,6 +271,8 @@ struct ip_mreq_source
/* IP address of interface. */
struct in_addr imr_sourceaddr;
};
+#endif
+
/* Likewise, for IPv6. */
struct ipv6_mreq
@@ -277,6 +285,7 @@ struct ipv6_mreq
};
+#if defined __USE_MISC || defined __USE_GNU
/* Multicast group request. */
struct group_req
{
@@ -343,6 +352,7 @@ struct group_filter
- sizeof (struct sockaddr_storage) \
+ ((numsrc) \
* sizeof (struct sockaddr_storage)))
+#endif
/* Get system-specific definitions. */
@@ -432,13 +442,17 @@ libc_hidden_proto(htons)
&& (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
&& (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
+#if defined __USE_MISC || defined __USE_GNU
/* Bind socket to a privileged IP port. */
extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
libc_hidden_proto(bindresvport)
+# if 0 /*def __UCLIBC_HAS_IPV6__*/
/* The IPv6 version of this function. */
extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
__THROW;
+# endif
+#endif
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
@@ -461,6 +475,8 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+
+#if 0 /*def __USE_GNU*/
/* IPv6 packet information. */
struct in6_pktinfo
{
@@ -476,7 +492,6 @@ struct ip6_mtuinfo
};
-#if 0 /*def __USE_GNU*/
/* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */
extern int inet6_option_space (int __nbytes)
__THROW __attribute_deprecated__;
diff --git a/include/netinet/ip6.h b/include/netinet/ip6.h
index bef2af2f5..c82b277e1 100644
--- a/include/netinet/ip6.h
+++ b/include/netinet/ip6.h
@@ -102,11 +102,11 @@ struct ip6_frag
uint32_t ip6f_ident; /* identification */
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
# define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
@@ -176,11 +176,11 @@ struct ip6_opt_router
};
/* Router alert values (in network byte order) */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0001
# define IP6_ALERT_AN 0x0002
-#else /* BYTE_ORDER == LITTLE_ENDING */
+#else /* __BYTE_ORDER == __LITTLE_ENDING */
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0100
# define IP6_ALERT_AN 0x0200
diff --git a/include/netinet/protocols.h b/include/netinet/protocols.h
deleted file mode 100644
index 1a619c474..000000000
--- a/include/netinet/protocols.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* protocols.h */
-#ifndef _NETINET_PROTOCOLS_H
-#define _NETINET_PROTOCOLS_H
-
-#define IP_ICMP 1
-#define IP_IGMP 2
-#define IP_GGP 3
-#define IP_ST 5
-#define IP_TCP 6
-#define IP_UCL 7
-#define IP_EGP 8
-#define IP_IGP 9
-#define IP_BBN_RCC_MON 10
-#define IP_NVP_II 11
-#define IP_PUP 12
-#define IP_ARGUS 13
-#define IP_EMCON 14
-#define IP_XNET 15
-#define IP_CHAOS 16
-#define IP_UDP 17
-#define IP_MUX 18
-#define IP_DCN_MEAS 19
-#define IP_HMP 20
-#define IP_PRM 21
-#define IP_XNS_IDP 22
-#define IP_TRUNK1 23
-#define IP_TRUNK2 24
-#define IP_LEAF1 25
-#define IP_LEAF2 26
-#define IP_RDP 27
-#define IP_IRTP 28
-#define IP_ISO_TP4 29
-#define IP_NETBLT 30
-#define IP_MFE_NSP 31
-#define IP_MERIT_INP 32
-#define IP_SEP 33
-#define IP_3PC 34
-#define IP_CFTP 62
-#define SAT_EXPAK 64
-#define IP_RVD 66
-#define IP_IPPC 67
-#define IP_SAT_MON 69
-#define IP_VISA 70
-#define IP_IPCV 71
-#define IP_BR_SAT_MON 76
-#define IP_SUN_ND 77
-#define IP_WB_MON 78
-#define IP_WB_EXPAK 79
-#define IP_ISO_IP 80
-#define IP_VMTP 81
-#define IP_SECURE_VMTP 82
-#define IP_VINES 83
-#define IP_TTP 84
-#define NSFNET_IGP 85
-#define IP_DGP 86
-#define IP_TCF 87
-#define IP_IGRP 88
-#define IP_OSPFIGP 89
-#define IP_SPRITE_RPG 90
-#define IP_LARP 91
-
-#endif /* _NETINET_PROTOCOLS_H*/
diff --git a/include/nl_types.h b/include/nl_types.h
index 74e762113..d6d48ecd9 100644
--- a/include/nl_types.h
+++ b/include/nl_types.h
@@ -40,6 +40,7 @@ typedef void *nl_catd;
/* Type used by `nl_langinfo'. */
typedef int nl_item;
+#if 0
/* Open message catalog for later use, returning descriptor.
This function is a possible cancellation point and therefore not
@@ -53,6 +54,7 @@ extern char *catgets (nl_catd __catalog, int __set, int __number,
/* Close message CATALOG. */
extern int catclose (nl_catd __catalog) __THROW __nonnull ((1));
+#endif
__END_DECLS
diff --git a/include/paths.h b/include/paths.h
index ae892c4cf..305937fc5 100644
--- a/include/paths.h
+++ b/include/paths.h
@@ -64,7 +64,6 @@
#define _PATH_VI "/usr/bin/vi"
#define _PATH_WTMP "/var/log/wtmp"
-/* uClibc */
#ifdef _LIBC
#define _PATH_PASSWD "/etc/passwd"
#define _PATH_GROUP "/etc/group"
diff --git a/include/regexp.h b/include/regexp.h
index b7b50b710..57b7f93ea 100644
--- a/include/regexp.h
+++ b/include/regexp.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2004, 2008
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -81,6 +82,7 @@
__BEGIN_DECLS
+#if 0
/* Interface variables. They contain the results of the successful
calls to `setp' and `advance'. */
extern char *loc1;
@@ -89,6 +91,7 @@ extern char *loc2;
/* The use of this variable in the `advance' function is not
supported. */
extern char *locs;
+#endif
#ifndef __DO_NOT_DEFINE_COMPILE
@@ -129,8 +132,9 @@ compile (char *__restrict instring, char *__restrict expbuf,
__expr_ptr = (regex_t *) expbuf;
/* The remaining space in the buffer can be used for the compiled
pattern. */
- __expr_ptr->buffer = expbuf + sizeof (regex_t);
- __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
+ __expr_ptr->__REPB_PREFIX (buffer) = expbuf + sizeof (regex_t);
+ __expr_ptr->__REPB_PREFIX (allocated)
+ = endbuf - (char *) __expr_ptr->__REPB_PREFIX (buffer);
while ((__ch = (GETC ())) != eof)
{
@@ -162,7 +166,10 @@ compile (char *__restrict instring, char *__restrict expbuf,
}
__input_buffer[__current_size++] = __ch;
}
- __input_buffer[__current_size++] = '\0';
+ if (__current_size)
+ __input_buffer[__current_size++] = '\0';
+ else
+ __input_buffer = "";
/* Now compile the pattern. */
__error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
@@ -198,11 +205,13 @@ compile (char *__restrict instring, char *__restrict expbuf,
}
/* Everything is ok. */
- RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
+ RETURN ((char *) (__expr_ptr->__REPB_PREFIX (buffer)
+ + __expr_ptr->__REPB_PREFIX (used)));
}
#endif
+#if 0
/* Find the next match in STRING. The compiled regular expression is
found in the buffer starting at EXPBUF. `loc1' will return the
first character matched and `loc2' points to the next unmatched
@@ -215,6 +224,7 @@ extern int step (__const char *__restrict __string,
position of the first unmatched character. */
extern int advance (__const char *__restrict __string,
__const char *__restrict __expbuf) __THROW;
+#endif
__END_DECLS
diff --git a/include/rpc/auth.h b/include/rpc/auth.h
index e8390c885..ee5396fc5 100644
--- a/include/rpc/auth.h
+++ b/include/rpc/auth.h
@@ -176,11 +176,13 @@ extern AUTH *authunix_create_default (void);
libc_hidden_proto(authunix_create_default)
extern AUTH *authnone_create (void) __THROW;
libc_hidden_proto(authnone_create)
+#if 0
extern AUTH *authdes_create (const char *__servername, u_int __window,
struct sockaddr *__syncaddr, des_block *__ckey)
__THROW;
extern AUTH *authdes_pk_create (const char *, netobj *, u_int,
struct sockaddr *, des_block *) __THROW;
+#endif
#define AUTH_NONE 0 /* no authentication */
@@ -192,6 +194,7 @@ extern AUTH *authdes_pk_create (const char *, netobj *, u_int,
#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
#define AUTH_KERB 4 /* kerberos style */
+#if 0
/*
* Netname manipulating functions
*
@@ -216,6 +219,7 @@ extern int key_gendes (des_block *);
extern int key_setsecret (char *);
extern int key_secretkey_is_set (void);
extern int key_get_conv (char *, des_block *);
+#endif
/*
* XDR an opaque authentication struct.
diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h
index 7a6b8be8d..d51b7ce7c 100644
--- a/include/rpc/auth_des.h
+++ b/include/rpc/auth_des.h
@@ -24,6 +24,7 @@
__BEGIN_DECLS
+#if 0
/* There are two kinds of "names": fullnames and nicknames */
enum authdes_namekind
{
@@ -47,6 +48,7 @@ struct authdes_cred
struct authdes_fullname adc_fullname;
uint32_t adc_nickname;
};
+#endif
/* A timeval replacement for !32bit platforms */
struct rpc_timeval
@@ -55,6 +57,7 @@ struct rpc_timeval
uint32_t tv_usec; /* Microseconds. */
};
+#if 0
/* A des authentication verifier */
struct authdes_verf
{
@@ -102,6 +105,7 @@ extern int getpublickey (__const char *__name, char *__key) __THROW;
the key. */
extern int getsecretkey (__const char *__name, char *__key,
__const char *__passwd) __THROW;
+#endif
extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep,
struct rpc_timeval *__timeout) __THROW;
diff --git a/include/signal.h b/include/signal.h
index 31ebc133c..0a09c7ad4 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -376,10 +376,12 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# ifdef __UCLIBC_SUSV4_LEGACY__
/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
(causing them to fail with EINTR); if INTERRUPT is zero, make system
calls be restarted after signal SIG. */
extern int siginterrupt (int __sig, int __interrupt) __THROW;
+# endif
# include <bits/sigstack.h>
# ifdef __USE_XOPEN
diff --git a/include/stdlib.h b/include/stdlib.h
index e462c1c93..155b8f1ea 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -90,7 +90,7 @@ typedef union
# define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
# define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
# define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
-# if 0 /* def __WIFCONTINUED */
+# ifdef __WIFCONTINUED
# define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
# endif
#endif /* X/Open and <sys/wait.h> not included. */
@@ -141,12 +141,13 @@ __END_NAMESPACE_C99
#if 0
#define MB_CUR_MAX (__ctype_get_mb_cur_max ())
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
-#endif
+#else
#ifdef __UCLIBC_HAS_WCHAR__
#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)
#endif
+#endif
__BEGIN_NAMESPACE_STD
@@ -240,8 +241,7 @@ __END_NAMESPACE_C99
#endif /* ISO C99 or GCC and use MISC. */
-#ifdef __UCLIBC_HAS_XLOCALE__
-#ifdef __USE_GNU
+#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
@@ -296,9 +296,7 @@ extern long double strtold_l (__const char *__restrict __nptr,
__locale_t __loc)
__THROW __nonnull ((1, 3)) __wur;
#endif /* __UCLIBC_HAS_FLOATS__ */
-
#endif /* GNU */
-#endif /* __UCLIBC_HAS_XLOCALE__ */
#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
@@ -494,13 +492,16 @@ __END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD
/* Re-allocate the previously allocated block
in PTR, making the new block SIZE bytes long. */
+/* __attribute_malloc__ is not used, because if realloc returns
+ the same pointer that was passed to it, aliasing needs to be allowed
+ between objects pointed by the old and new pointers. */
extern void *realloc (void *__ptr, size_t __size)
- __THROW __attribute_malloc__ __attribute_warn_unused_result__;
+ __THROW __attribute_warn_unused_result__;
/* Free a block allocated by `malloc', `realloc' or `calloc'. */
extern void free (void *__ptr) __THROW;
__END_NAMESPACE_STD
-#ifdef __USE_MISC
+#if 0 /*def __USE_MISC*/
/* Free a block. An alias for `free'. (Sun Unices). */
extern void cfree (void *__ptr) __THROW;
#endif /* Use misc. */
@@ -560,10 +561,12 @@ extern char *getenv (__const char *__name) __THROW __nonnull ((1)) __wur;
libc_hidden_proto(getenv)
__END_NAMESPACE_STD
+#if 0
/* This function is similar to the above but returns NULL if the
programs is running with SUID or SGID enabled. */
extern char *__secure_getenv (__const char *__name)
__THROW __nonnull ((1)) __wur;
+#endif
#if defined __USE_SVID || defined __USE_XOPEN
/* The SVID says this is in <stdio.h>, but this seems a better place. */
@@ -659,7 +662,6 @@ extern char *canonicalize_file_name (__const char *__name)
__THROW __nonnull ((1)) __wur;
#endif
-#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
@@ -667,8 +669,7 @@ extern char *canonicalize_file_name (__const char *__name)
returns the name in RESOLVED. */
/* we choose to handle __resolved==NULL as crash :) */
extern char *realpath (__const char *__restrict __name,
- char *__restrict __resolved) __THROW __wur __nonnull((2));
-#endif
+ char *__restrict __resolved) __THROW __wur;
/* Shorthand for type of comparison functions. */
@@ -725,12 +726,11 @@ __END_NAMESPACE_C99
#endif
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+#if ( defined __USE_SVID || defined __USE_XOPEN_EXTENDED ) && defined __UCLIBC_HAS_FLOATS__
/* Convert floating point numbers to strings. The returned values are
valid only until another call to the same function. */
# ifdef __UCLIBC_SUSV3_LEGACY__
-
#if 0
/* Convert VALUE to a string with NDIGIT digits and return a pointer to
this. Set *DECPT with the position of the decimal character and *SIGN
@@ -752,6 +752,7 @@ extern char *gcvt (double __value, int __ndigit, char *__buf)
__THROW __nonnull ((3)) __wur;
# endif /* __UCLIBC_SUSV3_LEGACY__ */
+
# if 0 /*def __USE_MISC*/
/* Long double versions of above functions. */
extern char *qecvt (long double __value, int __ndigit,
@@ -784,6 +785,7 @@ extern int qfcvt_r (long double __value, int __ndigit,
# endif /* misc */
#endif /* use MISC || use X/Open Unix */
+
#ifdef __UCLIBC_HAS_WCHAR__
__BEGIN_NAMESPACE_STD
/* Return the length of the multibyte character
@@ -809,7 +811,7 @@ __END_NAMESPACE_STD
#endif /* __UCLIBC_HAS_WCHAR__ */
-#ifdef __USE_SVID
+#if 0 /*def __USE_SVID*/
/* Determine whether the string value of RESPONSE matches the affirmation
or negative response expression as specified by the LC_MESSAGES category
in the program's current locale. Returns 1 if affirmative, 0 if
diff --git a/include/sys/mman.h b/include/sys/mman.h
index 609f78a73..d46b92258 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -1,5 +1,5 @@
/* Definitions for BSD-style memory management.
- Copyright (C) 1994-2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1994-2000, 2003, 2004, 2005 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
@@ -59,8 +59,8 @@ extern void *mmap (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off_t __offset) __THROW;
libc_hidden_proto(mmap)
#else
-# ifdef __REDIRECT
-extern void * __REDIRECT (mmap,
+# ifdef __REDIRECT_NTH
+extern void * __REDIRECT_NTH (mmap,
(void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off64_t __offset),
mmap64);
diff --git a/include/sys/msg.h b/include/sys/msg.h
index 1fd64b2ac..cdc96be9b 100644
--- a/include/sys/msg.h
+++ b/include/sys/msg.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1996,1997,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,1999,2000,2003,2006,2007
+ 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
@@ -21,6 +22,9 @@
#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
/* Get common definition of System V style IPC. */
#include <sys/ipc.h>
@@ -66,8 +70,8 @@ extern int msgget (key_t __key, int __msgflg) __THROW;
This function is a cancellation point and therefore not marked with
__THROW. */
-extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
- long int __msgtyp, int __msgflg);
+extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
+ long int __msgtyp, int __msgflg);
/* Send message to message queue.
diff --git a/include/sys/poll.h b/include/sys/poll.h
index 13b913494..53ba6e2eb 100644
--- a/include/sys/poll.h
+++ b/include/sys/poll.h
@@ -30,8 +30,6 @@
/* Get the timespec definition. */
# define __need_timespec
# include <time.h>
-/* get NULL definition. */
-# include <stddef.h>
#endif
diff --git a/include/sys/shm.h b/include/sys/shm.h
index 8ec30b486..786ce752b 100644
--- a/include/sys/shm.h
+++ b/include/sys/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000, 2002 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
@@ -41,6 +41,7 @@ typedef __pid_t pid_t;
# endif
#endif /* X/Open */
+
__BEGIN_DECLS
/* The following System V style IPC functions implement a shared memory
diff --git a/include/sys/socket.h b/include/sys/socket.h
index fb5135d3d..0824fc855 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -1,5 +1,6 @@
/* Declarations of socket constants, types, and functions.
- Copyright (C) 1991,92,1994-2001,2003 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,1994-2001,2003,2005,2007,2008
+ 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
@@ -27,6 +28,10 @@ __BEGIN_DECLS
#include <sys/uio.h>
#define __need_size_t
#include <stddef.h>
+#ifdef __USE_GNU
+/* Get the __sigset_t definition. */
+# include <bits/sigset.h>
+#endif
/* This operating system-specific header file defines the SOCK_*, PF_*,
@@ -231,7 +236,7 @@ libc_hidden_proto(accept)
extern int shutdown (int __fd, int __how) __THROW;
-#ifdef __USE_XOPEN2K
+#if 0 /*def __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 d84ace5a2..170a4e633 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -375,6 +375,7 @@ extern int utimensat (int __fd, __const char *__path,
__const struct timespec __times[2],
int __flags)
__THROW __nonnull ((2));
+libc_hidden_proto(utimensat)
#endif
#ifdef __USE_XOPEN2K8
diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h
index e755bafc1..6199c5d02 100644
--- a/include/sys/statvfs.h
+++ b/include/sys/statvfs.h
@@ -54,8 +54,8 @@ extern int statvfs (__const char *__restrict __file,
__THROW __nonnull ((1, 2));
libc_hidden_proto(statvfs)
#else
-# ifdef __REDIRECT
-extern int __REDIRECT (statvfs,
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (statvfs,
(__const char *__restrict __file,
struct statvfs *__restrict __buf), statvfs64)
__nonnull ((1, 2));
@@ -76,8 +76,8 @@ extern int fstatvfs (int __fildes, struct statvfs *__buf)
__THROW __nonnull ((2));
libc_hidden_proto(fstatvfs)
#else
-# ifdef __REDIRECT
-extern int __REDIRECT (fstatvfs, (int __fildes, struct statvfs *__buf),
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
fstatvfs64) __nonnull ((2));
# else
# define fstatvfs fstatvfs64
diff --git a/include/sys/syscall.h b/include/sys/syscall.h
index db8364bcf..25264cf91 100644
--- a/include/sys/syscall.h
+++ b/include/sys/syscall.h
@@ -19,18 +19,18 @@
#ifndef _SYSCALL_H
#define _SYSCALL_H 1
+/* User application code should use syscall(). */
+
+#include <features.h>
+#include <bits/sysnum.h>
+#ifdef _LIBC
/* The _syscall#() macros are for uClibc internal use only.
- * User application code should use syscall() instead.
*
* The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable
* for use in uClibc as they lack PIC support etc, so for uClibc we use our own
* local _syscall# macros to be certain all such variations are handled
* properly.
*/
-
-#include <features.h>
-#include <bits/sysnum.h>
-#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
# include <bits/syscalls.h>
# include <bits/syscalls-common.h>
#endif
diff --git a/include/sys/timex.h b/include/sys/timex.h
index b4998f5ab..5e82d464d 100644
--- a/include/sys/timex.h
+++ b/include/sys/timex.h
@@ -116,7 +116,9 @@ struct timex
__BEGIN_DECLS
+#if 0
extern int __adjtimex (struct timex *__ntx) __THROW;
+#endif
extern int adjtimex (struct timex *__ntx) __THROW;
libc_hidden_proto(adjtimex)
diff --git a/include/sys/utsname.h b/include/sys/utsname.h
index 41534d553..7b57888ce 100644
--- a/include/sys/utsname.h
+++ b/include/sys/utsname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94,96,97,99,2002 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
@@ -29,26 +29,38 @@ __BEGIN_DECLS
#include <bits/utsname.h>
+#ifndef _UTSNAME_SYSNAME_LENGTH
+# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
+#endif
#ifndef _UTSNAME_NODENAME_LENGTH
# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
#endif
+#ifndef _UTSNAME_RELEASE_LENGTH
+# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_VERSION_LENGTH
+# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_MACHINE_LENGTH
+# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
+#endif
/* Structure describing the system and machine. */
struct utsname
{
/* Name of the implementation of the operating system. */
- char sysname[_UTSNAME_LENGTH];
+ char sysname[_UTSNAME_SYSNAME_LENGTH];
/* Name of this node on the network. */
char nodename[_UTSNAME_NODENAME_LENGTH];
/* Current release level of this implementation. */
- char release[_UTSNAME_LENGTH];
+ char release[_UTSNAME_RELEASE_LENGTH];
/* Current version level of this release. */
- char version[_UTSNAME_LENGTH];
+ char version[_UTSNAME_VERSION_LENGTH];
/* Name of the hardware type the system is running on. */
- char machine[_UTSNAME_LENGTH];
+ char machine[_UTSNAME_MACHINE_LENGTH];
#if _UTSNAME_DOMAIN_LENGTH - 0
/* Name of the domain of this node on the network. */
@@ -61,6 +73,7 @@ struct utsname
};
#ifdef __USE_SVID
+/* Note that SVID assumes all members have the same size. */
# define SYS_NMLN _UTSNAME_LENGTH
#endif
diff --git a/include/sys/wait.h b/include/sys/wait.h
index 59ccd9331..f283fe228 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -85,7 +85,7 @@ typedef union
# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
-# if 0 /*def __WIFCONTINUED*/
+# ifdef __WIFCONTINUED
# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
# endif
#endif /* <stdlib.h> not included. */
diff --git a/include/utmp.h b/include/utmp.h
index c198ede35..182f45e1c 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -37,6 +37,7 @@ __BEGIN_DECLS
+#ifdef __UCLIBC_HAS_LIBUTIL__
/* Make FD be the controlling terminal, stdin, stdout, and stderr;
then close FD. Returns 0 on success, nonzero on error. */
extern int login_tty (int __fd) __THROW;
@@ -51,6 +52,7 @@ extern int logout (__const char *__ut_line) __THROW;
/* Append to wtmp an entry for the current time and the given info. */
extern void logwtmp (__const char *__ut_line, __const char *__ut_name,
__const char *__ut_host) __THROW;
+#endif
/* Append entry UTMP to the wtmp-like file WTMP_FILE. */
extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp)
diff --git a/include/values.h b/include/values.h
index d8bd8b50a..daf95118a 100644
--- a/include/values.h
+++ b/include/values.h
@@ -53,7 +53,9 @@
#include <float.h>
#define MAXDOUBLE DBL_MAX
+#ifdef __UCLIBC_SUSV4_LEGACY__
#define MAXFLOAT FLT_MAX
+#endif
#define MINDOUBLE DBL_MIN
#define MINFLOAT FLT_MIN
#define DMINEXP DBL_MIN_EXP