summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/bits
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-08-24 00:15:09 +0000
committerMike Frysinger <vapier@gentoo.org>2006-08-24 00:15:09 +0000
commit64085a723ae341524e35b1b7cb13bfe0bd4794dc (patch)
treed4311a0b9460b08731a9c68110158e99787405a4 /libc/sysdeps/linux/common/bits
parent7320e0ffac2dd65a911fd6bdc8f65c1467eede5e (diff)
sync with upstream via psm
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r--libc/sysdeps/linux/common/bits/confname.h43
-rw-r--r--libc/sysdeps/linux/common/bits/dlfcn.h25
-rw-r--r--libc/sysdeps/linux/common/bits/huge_val.h66
-rw-r--r--libc/sysdeps/linux/common/bits/huge_valf.h53
-rw-r--r--libc/sysdeps/linux/common/bits/huge_vall.h29
-rw-r--r--libc/sysdeps/linux/common/bits/inf.h30
-rw-r--r--libc/sysdeps/linux/common/bits/local_lim.h30
-rw-r--r--libc/sysdeps/linux/common/bits/locale.h2
-rw-r--r--libc/sysdeps/linux/common/bits/mathcalls.h80
-rw-r--r--libc/sysdeps/linux/common/bits/mathdef.h6
-rw-r--r--libc/sysdeps/linux/common/bits/posix1_lim.h54
-rw-r--r--libc/sysdeps/linux/common/bits/posix_opt.h188
-rw-r--r--libc/sysdeps/linux/common/bits/resource.h33
-rw-r--r--libc/sysdeps/linux/common/bits/sched.h14
-rw-r--r--libc/sysdeps/linux/common/bits/shm.h1
-rw-r--r--libc/sysdeps/linux/common/bits/signum.h4
-rw-r--r--libc/sysdeps/linux/common/bits/sigthread.h26
-rw-r--r--libc/sysdeps/linux/common/bits/socket.h7
-rw-r--r--libc/sysdeps/linux/common/bits/stat.h43
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_local_lim.h32
-rw-r--r--libc/sysdeps/linux/common/bits/waitstatus.h18
21 files changed, 502 insertions, 282 deletions
diff --git a/libc/sysdeps/linux/common/bits/confname.h b/libc/sysdeps/linux/common/bits/confname.h
index a66f85aac..ab7fdee9d 100644
--- a/libc/sysdeps/linux/common/bits/confname.h
+++ b/libc/sysdeps/linux/common/bits/confname.h
@@ -63,8 +63,10 @@ enum
#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
_PC_ALLOC_SIZE_MIN,
#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
- _PC_SYMLINK_MAX
+ _PC_SYMLINK_MAX,
#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
+ _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS _PC_2_SYMLINKS
};
/* Values for the argument to `sysconf'. */
@@ -459,8 +461,45 @@ enum
#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
_SC_TRACE_INHERIT,
#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
- _SC_TRACE_LOG
+ _SC_TRACE_LOG,
#define _SC_TRACE_LOG _SC_TRACE_LOG
+
+ _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
+ _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
+ _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
+ _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
+ _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
+ _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
+ _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
+ _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
+ _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
+ _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
+ _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
+ _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
+ _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
+ _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
+ _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
+ /* Leave room here, maybe we need a few more cache levels some day. */
+
+ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+#define _SC_IPV6 _SC_IPV6
+ _SC_RAW_SOCKETS
+#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
};
#if (defined __USE_POSIX2 || defined __USE_UNIX98 \
diff --git a/libc/sysdeps/linux/common/bits/dlfcn.h b/libc/sysdeps/linux/common/bits/dlfcn.h
index 75122a98a..f68849843 100644
--- a/libc/sysdeps/linux/common/bits/dlfcn.h
+++ b/libc/sysdeps/linux/common/bits/dlfcn.h
@@ -1,5 +1,5 @@
/* System dependent definitions for run-time dynamic loading.
- Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
@@ -26,6 +26,7 @@
#define RTLD_NOW 0x00002 /* Immediate function call binding. */
#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
#define RTLD_NOLOAD 0x00004 /* Do not load the object. */
+#define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
/* If the following bit is set in the MODE argument to `dlopen',
the symbols of the loaded object and its dependencies are made
@@ -40,3 +41,25 @@
/* Do not delete object when closed. */
#define RTLD_NODELETE 0x01000
+#if 0 /*def __USE_GNU*/
+/* To support profiling of shared objects it is a good idea to call
+ the function found using `dlsym' using the following macro since
+ these calls do not use the PLT. But this would mean the dynamic
+ loader has no chance to find out when the function is called. The
+ macro applies the necessary magic so that profiling is possible.
+ Rewrite
+ foo = (*fctp) (arg1, arg2);
+ into
+ foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions. */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/libc/sysdeps/linux/common/bits/huge_val.h b/libc/sysdeps/linux/common/bits/huge_val.h
index b33974364..11ca11f18 100644
--- a/libc/sysdeps/linux/common/bits/huge_val.h
+++ b/libc/sysdeps/linux/common/bits/huge_val.h
@@ -1,6 +1,7 @@
-/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 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
@@ -22,25 +23,19 @@
# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
#endif
-#include <features.h>
-
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-#ifdef __GNUC__
-
-# if __GNUC_PREREQ(2,96)
-
-# define HUGE_VAL (__extension__ 0x1.0p2047)
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VAL (__builtin_huge_val())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
+#elif defined __GNUC__
-# else
-
-# define HUGE_VAL \
+# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
-# endif
-
#else /* not GCC */
# include <endian.h>
@@ -58,46 +53,3 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
# define HUGE_VAL (__huge_val.__d)
#endif /* GCC. */
-
-
-/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
-
-#ifdef __USE_ISOC99
-
-# ifdef __GNUC__
-
-# if __GNUC_PREREQ(2,96)
-
-# define HUGE_VALF (__extension__ 0x1.0p255f)
-
-# else
-
-# define HUGE_VALF \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
- { __l: 0x7f800000UL }).__d)
-
-# endif
-
-# else /* not GCC */
-
-typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
-# endif
-
-static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-# define HUGE_VALF (__huge_valf.__f)
-
-# endif /* GCC. */
-
-
-/* Generally there is no separate `long double' format and it is the
- same as `double'. */
-# define HUGE_VALL HUGE_VAL
-
-#endif /* __USE_ISOC99. */
diff --git a/libc/sysdeps/linux/common/bits/huge_valf.h b/libc/sysdeps/linux/common/bits/huge_valf.h
new file mode 100644
index 000000000..1785342cd
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/huge_valf.h
@@ -0,0 +1,53 @@
+/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALF (__builtin_huge_valf())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+#elif defined __GNUC__
+
+# define HUGE_VALF \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
+# endif
+
+static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
+# define HUGE_VALF (__huge_valf.__f)
+
+#endif /* GCC. */
diff --git a/libc/sysdeps/linux/common/bits/huge_vall.h b/libc/sysdeps/linux/common/bits/huge_vall.h
new file mode 100644
index 000000000..d5e8e2237
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/huge_vall.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VALL' constant.
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1996, 1997, 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALL (__builtin_huge_vall())
+#else
+# define HUGE_VALL ((long double) HUGE_VAL)
+#endif
diff --git a/libc/sysdeps/linux/common/bits/inf.h b/libc/sysdeps/linux/common/bits/inf.h
new file mode 100644
index 000000000..1619f756e
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/inf.h
@@ -0,0 +1,30 @@
+/* `INFINITY' constant for IEEE 754 machines.
+ Copyright (C) 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/inf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity. */
+
+#if __GNUC_PREREQ(3,3)
+# define INFINITY (__builtin_inff())
+#else
+# define INFINITY HUGE_VALF
+#endif
diff --git a/libc/sysdeps/linux/common/bits/local_lim.h b/libc/sysdeps/linux/common/bits/local_lim.h
index d4671e4a8..b639ba44a 100644
--- a/libc/sysdeps/linux/common/bits/local_lim.h
+++ b/libc/sysdeps/linux/common/bits/local_lim.h
@@ -1,11 +1,11 @@
/* Minimum guaranteed maximum values for system limits. Linux version.
- Copyright (C) 1993-1998, 2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1993-1998,2000,2002,2003,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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,9 +13,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* The kernel header pollutes the namespace with the NR_OPEN symbol
and defines LINK_MAX although filesystems have different maxima. A
@@ -63,16 +63,19 @@
/* The number of threads per process. */
#define _POSIX_THREAD_THREADS_MAX 64
-/* This is the value this implementation supports. */
-#define PTHREAD_THREADS_MAX 1024
-
-/* Minimum size for a thread. We are free to choose a reasonable value. */
-#define PTHREAD_STACK_MIN 16384
+/* We have no predefined limit on the number of threads. */
+#undef PTHREAD_THREADS_MAX
/* Maximum amount by which a process can descrease its asynchronous I/O
priority level. */
#define AIO_PRIO_DELTA_MAX 20
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
/* Maximum tty name length. */
#define TTY_NAME_MAX 32
@@ -84,6 +87,3 @@
/* Maximum message queue priority level. */
#define MQ_PRIO_MAX 32768
-
-/* Maximum number of POSIX timers available. */
-#define TIMER_MAX 256
diff --git a/libc/sysdeps/linux/common/bits/locale.h b/libc/sysdeps/linux/common/bits/locale.h
index 50064b53e..5d5178361 100644
--- a/libc/sysdeps/linux/common/bits/locale.h
+++ b/libc/sysdeps/linux/common/bits/locale.h
@@ -33,12 +33,14 @@ enum
__LC_MONETARY = 4,
__LC_MESSAGES = 5,
__LC_ALL = 6,
+#if 0
__LC_PAPER = 7,
__LC_NAME = 8,
__LC_ADDRESS = 9,
__LC_TELEPHONE = 10,
__LC_MEASUREMENT = 11,
__LC_IDENTIFICATION = 12
+#endif
};
#endif /* bits/locale.h */
diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h
index c1181f737..c02007284 100644
--- a/libc/sysdeps/linux/common/bits/mathcalls.h
+++ b/libc/sysdeps/linux/common/bits/mathcalls.h
@@ -1,5 +1,5 @@
/* Prototype declarations for math functions; helper file for <math.h>.
- Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1996-2002, 2003, 2006 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
@@ -44,12 +44,13 @@
NAME, to make token pasting work with -traditional. */
#ifndef _MATH_H
- #error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
+# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
#endif
/* Trigonometric functions. */
+_Mdouble_BEGIN_NAMESPACE
/* Arc cosine of X. */
__MATHCALL (acos,, (_Mdouble_ __x));
/* Arc sine of X. */
@@ -66,12 +67,6 @@ __MATHCALL (sin,, (_Mdouble_ __x));
/* Tangent of X. */
__MATHCALL (tan,, (_Mdouble_ __x));
-#ifdef __USE_GNU
-/* Cosine and sine of X. */
-__MATHDECL (void,sincos,,
- (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
-#endif
-
/* Hyperbolic functions. */
/* Hyperbolic cosine of X. */
@@ -80,28 +75,31 @@ __MATHCALL (cosh,, (_Mdouble_ __x));
__MATHCALL (sinh,, (_Mdouble_ __x));
/* Hyperbolic tangent of X. */
__MATHCALL (tanh,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* Cosine and sine of X. */
+__MATHDECL (void,sincos,,
+ (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
+#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Hyperbolic arc cosine of X. */
__MATHCALL (acosh,, (_Mdouble_ __x));
/* Hyperbolic arc sine of X. */
__MATHCALL (asinh,, (_Mdouble_ __x));
/* Hyperbolic arc tangent of X. */
__MATHCALL (atanh,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
#endif
/* Exponential and logarithmic functions. */
+_Mdouble_BEGIN_NAMESPACE
/* Exponential function of X. */
__MATHCALL (exp,, (_Mdouble_ __x));
-#ifdef __USE_GNU
-/* A function missing in all standards: compute exponent to base ten. */
-__MATHCALL (exp10,, (_Mdouble_ __x));
-/* Another name occasionally used. */
-__MATHCALL (pow10,, (_Mdouble_ __x));
-#endif
-
/* Break VALUE into a normalized fraction and an integral power of 2. */
__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
@@ -116,8 +114,17 @@ __MATHCALL (log10,, (_Mdouble_ __x));
/* Break VALUE into integral and fractional parts. */
__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* A function missing in all standards: compute exponent to base ten. */
+__MATHCALL (exp10,, (_Mdouble_ __x));
+/* Another name occasionally used. */
+__MATHCALL (pow10,, (_Mdouble_ __x));
+#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return exp(X) - 1. */
__MATHCALL (expm1,, (_Mdouble_ __x));
@@ -126,46 +133,56 @@ __MATHCALL (log1p,, (_Mdouble_ __x));
/* Return the base 2 signed integral exponent of X. */
__MATHCALL (logb,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
#endif
#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Compute base-2 exponential of X. */
__MATHCALL (exp2,, (_Mdouble_ __x));
/* Compute base-2 logarithm of X. */
__MATHCALL (log2,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
#endif
/* Power functions. */
+_Mdouble_BEGIN_NAMESPACE
/* Return X to the Y power. */
__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
/* Return the square root of X. */
__MATHCALL (sqrt,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return `sqrt(X*X + Y*Y)'. */
__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
+__END_NAMESPACE_C99
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return the cube root of X. */
__MATHCALL (cbrt,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
#endif
/* Nearest integer, absolute value, and remainder functions. */
+_Mdouble_BEGIN_NAMESPACE
/* Smallest integral value not less than X. */
-__MATHCALL (ceil,, (_Mdouble_ __x));
+__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
/* Absolute value of X. */
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
/* Largest integer not greater than X. */
-__MATHCALL (floor,, (_Mdouble_ __x));
+__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
/* Floating-point modulo remainder of X/Y. */
__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
@@ -177,6 +194,7 @@ __MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
/* Return nonzero if VALUE is finite and not NaN. */
__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
+_Mdouble_END_NAMESPACE
#ifdef __USE_MISC
/* Return 0 if VALUE is finite or NaN, +1 if it
@@ -195,13 +213,17 @@ __MATHCALL (significand,, (_Mdouble_ __x));
#endif /* Use misc. */
#if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return X with its signed changed to Y's. */
__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+__END_NAMESPACE_C99
#endif
#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return representation of NaN for double type. */
__MATHCALLX (nan,, (__const char *__tagb), (__const__));
+__END_NAMESPACE_C99
#endif
@@ -223,14 +245,19 @@ __MATHCALL (yn,, (int, _Mdouble_));
#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Error and gamma functions. */
__MATHCALL (erf,, (_Mdouble_));
__MATHCALL (erfc,, (_Mdouble_));
__MATHCALL (lgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
#endif
#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* True gamma function. */
__MATHCALL (tgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
#endif
#if defined __USE_MISC || defined __USE_XOPEN
@@ -247,24 +274,20 @@ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Return the integer nearest X in the direction of the
prevailing rounding mode. */
__MATHCALL (rint,, (_Mdouble_ __x));
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# ifdef __USE_ISOC99
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
# endif
/* Return the remainder of integer divison X / Y with infinite precision. */
__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Return X times (2 to the Nth power). */
-__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
-# endif
-
# if defined __USE_MISC || defined __USE_ISOC99
/* Return X times (2 to the Nth power). */
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
@@ -284,7 +307,7 @@ __MATHCALL (nearbyint,, (_Mdouble_ __x));
/* Round X to nearest integral value, rounding halfway cases away from
zero. */
-__MATHCALL (round,, (_Mdouble_ __x));
+__MATHCALLX (round,, (_Mdouble_ __x), (__const__));
/* Round X to the integral value in floating-point format nearest but
not larger in magnitude. */
@@ -331,3 +354,12 @@ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
/* Multiply-add function computed as a ternary operation. */
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
#endif /* Use ISO C99. */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
+#endif
diff --git a/libc/sysdeps/linux/common/bits/mathdef.h b/libc/sysdeps/linux/common/bits/mathdef.h
index d08dc3820..00c67241a 100644
--- a/libc/sysdeps/linux/common/bits/mathdef.h
+++ b/libc/sysdeps/linux/common/bits/mathdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 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
@@ -30,10 +30,6 @@ typedef double float_t; /* `float' expressions are evaluated as
typedef double double_t; /* `double' expressions are evaluated as
`double'. */
-/* Define `INFINITY' as value of type `float'. */
-# define INFINITY HUGE_VALF
-
-
/* The values returned by `ilogb' for 0 and NaN respectively. */
# define FP_ILOGB0 (-2147483647)
# define FP_ILOGBNAN 2147483647
diff --git a/libc/sysdeps/linux/common/bits/posix1_lim.h b/libc/sysdeps/linux/common/bits/posix1_lim.h
index 9379d46f4..3c86dcec1 100644
--- a/libc/sysdeps/linux/common/bits/posix1_lim.h
+++ b/libc/sysdeps/linux/common/bits/posix1_lim.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,96,98,2000,01,02,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,96,98,2000-2003,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
@@ -38,14 +38,25 @@
#define _POSIX_ARG_MAX 4096
/* Maximum simultaneous processes per real user ID. */
-#define _POSIX_CHILD_MAX 6
+#ifdef __USE_XOPEN2K
+# define _POSIX_CHILD_MAX 25
+#else
+# define _POSIX_CHILD_MAX 6
+#endif
/* Minimal number of timer expiration overruns. */
#define _POSIX_DELAYTIMER_MAX 32
+/* Maximum length of a host name (not including the terminating null)
+ as returned from the GETHOSTNAME function. */
+#define _POSIX_HOST_NAME_MAX 255
+
/* Maximum link count of a file. */
#define _POSIX_LINK_MAX 8
+/* Maximum length of login name. */
+#define _POSIX_LOGIN_NAME_MAX 9
+
/* Number of bytes in a terminal canonical input queue. */
#define _POSIX_MAX_CANON 255
@@ -59,6 +70,9 @@
/* Maximum number of supported message priorities. */
#define _POSIX_MQ_PRIO_MAX 32
+/* Number of bytes in a filename. */
+#define _POSIX_NAME_MAX 14
+
/* Number of simultaneous supplementary group IDs per process. */
#ifdef __USE_XOPEN2K
# define _POSIX_NGROUPS_MAX 8
@@ -67,21 +81,26 @@
#endif
/* Number of files one process can have open at once. */
-#define _POSIX_OPEN_MAX 16
+#ifdef __USE_XOPEN2K
+# define _POSIX_OPEN_MAX 20
+#else
+# define _POSIX_OPEN_MAX 16
+#endif
/* Number of descriptors that a process may examine with `pselect' or
`select'. */
#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
-/* Number of bytes in a filename. */
-#define _POSIX_NAME_MAX 14
-
/* Number of bytes in a pathname. */
#define _POSIX_PATH_MAX 256
/* Number of bytes than can be written atomically to a pipe. */
#define _POSIX_PIPE_BUF 512
+/* The number of repeated occurrences of a BRE permitted by the
+ REGEXEC and REGCOMP functions when using the interval notation. */
+#define _POSIX_RE_DUP_MAX 255
+
/* Minimal number of realtime signals reserved for the application. */
#define _POSIX_RTSIG_MAX 8
@@ -100,6 +119,19 @@
/* Number of streams a process can have open at once. */
#define _POSIX_STREAM_MAX 8
+/* The number of bytes in a symbolic link. */
+#define _POSIX_SYMLINK_MAX 255
+
+/* The number of symbolic links that can be traversed in the
+ resolution of a pathname in the absence of a loop. */
+#define _POSIX_SYMLOOP_MAX 8
+
+/* Number of timer for a process. */
+#define _POSIX_TIMER_MAX 32
+
+/* Maximum number of characters in a tty name. */
+#define _POSIX_TTY_NAME_MAX 9
+
/* Maximum length of a timezone name (element of `tzname'). */
#define _POSIX_TZNAME_MAX 6
@@ -113,21 +145,13 @@
/* Maximum number of elements in an `iovec' array. */
#define _POSIX_UIO_MAXIOV 16
-/* Maximum number of characters in a tty name. */
-#define _POSIX_TTY_NAME_MAX 9
-
-/* Number of timer for a process. */
-#define _POSIX_TIMER_MAX 32
-
-/* Maximum length of login name. */
-#define _POSIX_LOGIN_NAME_MAX 9
-
/* Maximum clock resolution in nanoseconds. */
#define _POSIX_CLOCKRES_MIN 20000000
/* Get the implementation-specific values for the above. */
#include <bits/local_lim.h>
+#include <bits/uClibc_local_lim.h>
#ifndef SSIZE_MAX
diff --git a/libc/sysdeps/linux/common/bits/posix_opt.h b/libc/sysdeps/linux/common/bits/posix_opt.h
index b2cae9d41..92c2d3282 100644
--- a/libc/sysdeps/linux/common/bits/posix_opt.h
+++ b/libc/sysdeps/linux/common/bits/posix_opt.h
@@ -1,11 +1,11 @@
/* Define POSIX options for Linux.
- Copyright (C) 1996,1997,1999,2000,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2002, 2003, 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,16 +13,12 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-/*
- * Never include this file directly; use <unistd.h> instead.
- */
-
-#ifndef _BITS_POSIX_OPT_H
-#define _BITS_POSIX_OPT_H 1
+#ifndef _POSIX_OPT_H
+#define _POSIX_OPT_H 1
/* Job control is supported. */
#define _POSIX_JOB_CONTROL 1
@@ -43,31 +39,13 @@
#define _POSIX_MAPPED_FILES 200112L
/* Locking of all memory is supported. */
-#ifdef __ARCH_USE_MMU__
-# define _POSIX_MEMLOCK 200112L
-#else
-# undef _POSIX_MEMLOCK
-#endif
+#define _POSIX_MEMLOCK 200112L
/* Locking of ranges of memory is supported. */
-#ifdef __ARCH_USE_MMU__
-# define _POSIX_MEMLOCK_RANGE 200112L
-#else
-# define _POSIX_MEMLOCK_RANGE
-#endif
+#define _POSIX_MEMLOCK_RANGE 200112L
/* Setting of memory protections is supported. */
-#ifdef __ARCH_USE_MMU__
-# define _POSIX_MEMORY_PROTECTION 1
-#else
-# undef _POSIX_MEMORY_PROTECTION
-#endif
-
-/* Implementation supports `poll' function. */
-#define _POSIX_POLL 1
-
-/* Implementation supports `select' and `pselect' functions. */
-#define _POSIX_SELECT 1
+#define _POSIX_MEMORY_PROTECTION 200112L
/* Only root can change owner of file. */
#define _POSIX_CHOWN_RESTRICTED 1
@@ -82,115 +60,119 @@
/* X/Open realtime support is available. */
#define _XOPEN_REALTIME 1
-/* X/Open realtime thread support is available. */
-#ifdef __UCLIBC_HAS_THREADS__
-# define _XOPEN_REALTIME_THREADS 1
-#else
-# undef _XOPEN_REALTIME_THREADS
-#endif
-
/* XPG4.2 shared memory is supported. */
#define _XOPEN_SHM 1
/* Tell we have POSIX threads. */
-#ifdef __UCLIBC_HAS_THREADS__
-# define _POSIX_THREADS 1
-#else
-# undef _POSIX_THREADS
-#endif
+#define _POSIX_THREADS 200112L
/* We have the reentrant functions described in POSIX. */
-#ifdef __UCLIBC_HAS_THREADS__
-# define _POSIX_REENTRANT_FUNCTIONS 1
-# define _POSIX_THREAD_SAFE_FUNCTIONS 1
-#else
-# undef _POSIX_REENTRANT_FUNCTIONS
-# undef _POSIX_THREAD_SAFE_FUNCTIONS
-#endif
+#define _POSIX_REENTRANT_FUNCTIONS 1
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
/* We provide priority scheduling for threads. */
-#define _POSIX_THREAD_PRIORITY_SCHEDULING 1
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
/* We support user-defined stack sizes. */
-#define _POSIX_THREAD_ATTR_STACKSIZE 1
+#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
/* We support user-defined stacks. */
-#define _POSIX_THREAD_ATTR_STACKADDR 1
+#define _POSIX_THREAD_ATTR_STACKADDR 200112L
-/* We support POSIX.1b semaphores, but only the non-shared form for now. */
-#ifdef __UCLIBC_HAS_THREADS__
-# define _POSIX_SEMAPHORES 1
-#else
-# undef _POSIX_SEMAPHORES
-#endif
+/* We support POSIX.1b semaphores. */
+#define _POSIX_SEMAPHORES 200112L
/* Real-time signals are supported. */
#define _POSIX_REALTIME_SIGNALS 200112L
/* We support asynchronous I/O. */
-#define _POSIX_ASYNCHRONOUS_IO 1
+#define _POSIX_ASYNCHRONOUS_IO 200112L
#define _POSIX_ASYNC_IO 1
/* Alternative name for Unix98. */
#define _LFS_ASYNCHRONOUS_IO 1
+/* Support for prioritization is also available. */
+#define _POSIX_PRIORITIZED_IO 200112L
/* The LFS support in asynchronous I/O is also available. */
-#ifdef __UCLIBC_HAS_LFS__
-# define _LFS64_ASYNCHRONOUS_IO 1
-#else
-# undef _LFS64_ASYNCHRONOUS_IO
-#endif
+#define _LFS64_ASYNCHRONOUS_IO 1
/* The rest of the LFS is also available. */
-#ifdef __UCLIBC_HAS_LFS__
-# define _LFS_LARGEFILE 1
-# define _LFS64_LARGEFILE 1
-# define _LFS64_STDIO 1
-#else
-# undef _LFS_LARGEFILE
-# undef _LFS64_LARGEFILE
-# undef _LFS64_STDIO
-#endif
-
-/* POSIX timers are available. */
-#define _POSIX_TIMERS 200112L
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 1
/* POSIX shared memory objects are implemented. */
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
-#if defined(__i386__)
-/* CPU-time clocks supported. */
-# define _POSIX_CPUTIME 200912L
-
-/* We support the clock also in threads. */
-# define _POSIX_THREAD_CPUTIME 200912L
-#endif
+/* CPU-time clocks support needs to be checked at runtime. */
+#define _POSIX_CPUTIME 0
-/* Reader/Writer locks are available. */
-#define _POSIX_READER_WRITER_LOCKS 200912L
+/* Clock support in threads must be also checked at runtime. */
+#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
-#ifdef __UCLIBC_HAS_REGEX__
-# define _POSIX_REGEXP 1
-#else
-# undef _POSIX_REGEXP
-#endif
+#define _POSIX_REGEXP 1
+
+/* Reader/Writer locks are available. */
+#define _POSIX_READER_WRITER_LOCKS 200112L
/* We have a POSIX shell. */
#define _POSIX_SHELL 1
-/* The `spawn' function family is supported. */
-#define _POSIX_SPAWN 200912L
-
/* We support the Timeouts option. */
-#define _POSIX_TIMEOUTS 200912L
+#define _POSIX_TIMEOUTS 200112L
/* We support spinlocks. */
-#define _POSIX_SPIN_LOCKS 200912L
+#define _POSIX_SPIN_LOCKS 200112L
+
+/* The `spawn' function family is supported. */
+#define _POSIX_SPAWN 200112L
+
+/* We have POSIX timers. */
+#define _POSIX_TIMERS 200112L
/* The barrier functions are available. */
-#define _POSIX_BARRIERS 200912L
+#define _POSIX_BARRIERS 200112L
+
+/* POSIX message queues are available. */
+#define _POSIX_MESSAGE_PASSING 200112L
+
+/* Thread process-shared synchronization is supported. */
+#define _POSIX_THREAD_PROCESS_SHARED 200112L
+
+/* The monotonic clock might be available. */
+#define _POSIX_MONOTONIC_CLOCK 0
+
+/* The clock selection interfaces are available. */
+#define _POSIX_CLOCK_SELECTION 200112L
+
+/* Advisory information interfaces are available. */
+#define _POSIX_ADVISORY_INFO 200112L
+
+/* IPv6 support is available. */
+#define _POSIX_IPV6 200112L
+
+/* Raw socket support is available. */
+#define _POSIX_RAW_SOCKETS 200112L
+
+/* We have at least one terminal. */
+#define _POSIX2_CHAR_TERM 200112L
+
+/* Neither process nor thread sporadic server interfaces is available. */
+#define _POSIX_SPORADIC_SERVER -1
+#define _POSIX_THREAD_SPORADIC_SERVER -1
+
+/* trace.h is not available. */
+#define _POSIX_TRACE -1
+#define _POSIX_TRACE_EVENT_FILTER -1
+#define _POSIX_TRACE_INHERIT -1
+#define _POSIX_TRACE_LOG -1
+
+/* Typed memory objects are not available. */
+#define _POSIX_TYPED_MEMORY_OBJECTS -1
-/* POSIX message queues are not yet supported. */
-#undef _POSIX_MESSAGE_PASSING
+/* No support for priority inheritance or protection so far. */
+#define _POSIX_THREAD_PRIO_INHERIT -1
+#define _POSIX_THREAD_PRIO_PROTECT -1
-#endif /* bits/posix_opt.h */
+#endif /* posix_opt.h */
diff --git a/libc/sysdeps/linux/common/bits/resource.h b/libc/sysdeps/linux/common/bits/resource.h
index 1d438122e..526cdaf53 100644
--- a/libc/sysdeps/linux/common/bits/resource.h
+++ b/libc/sysdeps/linux/common/bits/resource.h
@@ -81,7 +81,26 @@ enum __rlimit_resource
__RLIMIT_LOCKS = 10,
#define RLIMIT_LOCKS __RLIMIT_LOCKS
- __RLIMIT_NLIMITS = 11,
+ /* Maximum number of pending signals. */
+ __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+ /* Maximum bytes in POSIX message queues. */
+ __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+ /* Maximum nice priority allowed to raise to.
+ Nice levels 19 .. -20 correspond to 0 .. 39
+ values of this resource limit. */
+ __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+ /* Maximum realtime priority allowed for non-priviledged
+ processes. */
+ __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+ __RLIMIT_NLIMITS = 15,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
#define RLIM_NLIMITS __RLIM_NLIMITS
@@ -89,13 +108,13 @@ enum __rlimit_resource
/* Value to indicate that there is no limit. */
#ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY ((long int)(~0UL >> 1))
+# define RLIM_INFINITY ((unsigned long int)(~0UL))
#else
-# define RLIM_INFINITY 0x7fffffffffffffffLL
+# define RLIM_INFINITY 0xffffffffffffffffuLL
#endif
#ifdef __USE_LARGEFILE64
-# define RLIM64_INFINITY 0x7fffffffffffffffLL
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
#endif
/* We can represent all limits. */
@@ -139,12 +158,8 @@ enum __rusage_who
#define RUSAGE_SELF RUSAGE_SELF
/* All of its terminated child processes. */
- RUSAGE_CHILDREN = -1,
+ RUSAGE_CHILDREN = -1
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
-
- /* Both. */
- RUSAGE_BOTH = -2
-#define RUSAGE_BOTH RUSAGE_BOTH
};
#define __need_timeval
diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h
index 78f18ad4e..b48a0c874 100644
--- a/libc/sysdeps/linux/common/bits/sched.h
+++ b/libc/sysdeps/linux/common/bits/sched.h
@@ -29,7 +29,7 @@
#define SCHED_OTHER 0
#define SCHED_FIFO 1
#define SCHED_RR 2
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_GNU
# define SCHED_BATCH 3
#endif
@@ -46,7 +46,6 @@
# define CLONE_PARENT 0x00008000 /* Set if we want to have the same
parent as the cloner. */
# define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */
-#if 0
# define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */
# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */
# define CLONE_SETTLS 0x00080000 /* Set TLS info. */
@@ -61,9 +60,6 @@
the child. */
# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
#endif
-#endif
-
-#ifndef __ASSEMBLER__
/* The official definition. */
struct sched_param
@@ -86,12 +82,8 @@ extern int unshare (int __flags) __THROW;
__END_DECLS
-#endif /* __ASSEMBLER__ */
-
#endif /* need schedparam */
-#ifndef __ASSEMBLER__
-
#if !defined __defined_schedparam \
&& (defined __need_schedparam || defined _SCHED_H)
# define __defined_schedparam 1
@@ -104,7 +96,6 @@ struct __sched_param
#endif
-#if 0
#if defined _SCHED_H && !defined __cpu_set_t_defined
# define __cpu_set_t_defined
/* Size definition for CPU sets. */
@@ -139,6 +130,3 @@ typedef struct
# define __CPU_ISSET(cpu, cpusetp) \
(((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
#endif
-#endif
-
-#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/linux/common/bits/shm.h b/libc/sysdeps/linux/common/bits/shm.h
index 225b89db2..318d601ae 100644
--- a/libc/sysdeps/linux/common/bits/shm.h
+++ b/libc/sysdeps/linux/common/bits/shm.h
@@ -73,6 +73,7 @@ struct shmid_ds
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
# define SHM_LOCKED 02000 /* segment will not be swapped */
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
+# define SHM_NORESERVE 010000 /* don't check for reservations */
struct shminfo
{
diff --git a/libc/sysdeps/linux/common/bits/signum.h b/libc/sysdeps/linux/common/bits/signum.h
index 74259b492..a18ac113a 100644
--- a/libc/sysdeps/linux/common/bits/signum.h
+++ b/libc/sysdeps/linux/common/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. Linux version.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1997,1998,1999,2003 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
@@ -66,7 +66,7 @@
#define SIGSYS 31 /* Bad system call. */
#define SIGUNUSED 31
-#define _NSIG 64 /* Biggest signal number + 1
+#define _NSIG 65 /* Biggest signal number + 1
(including real-time signals). */
#define SIGRTMIN (__libc_current_sigrtmin ())
diff --git a/libc/sysdeps/linux/common/bits/sigthread.h b/libc/sysdeps/linux/common/bits/sigthread.h
index 9e6b62e4b..960bde18a 100644
--- a/libc/sysdeps/linux/common/bits/sigthread.h
+++ b/libc/sysdeps/linux/common/bits/sigthread.h
@@ -1,11 +1,11 @@
-/* Signal handling function for threaded programs. Generic version.
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* Signal handling function for threaded programs.
+ Copyright (C) 1998, 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,9 +13,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef _BITS_SIGTHREAD_H
#define _BITS_SIGTHREAD_H 1
@@ -24,15 +24,15 @@
# error "Never include this file directly. Use <pthread.h> instead"
#endif
-/* Modify the signal mask for the calling thread. The arguments have the
- same meaning as for sigprocmask; in fact, this and sigprocmask might be
- the same function. We declare this the same on all platforms, since it
- doesn't use any thread-related types. */
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread. The arguments have
+ the same meaning as for sigprocmask(2). */
extern int pthread_sigmask (int __how,
__const __sigset_t *__restrict __newmask,
__sigset_t *__restrict __oldmask)__THROW;
/* Send signal SIGNO to the given thread. */
-extern int pthread_kill (pthread_t __thread_id, int __signo) __THROW;
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
#endif /* bits/sigthread.h */
diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
index 2466c0cd1..cc13c4874 100644
--- a/libc/sysdeps/linux/common/bits/socket.h
+++ b/libc/sysdeps/linux/common/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991,1992,1994-2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1991,1992,1994-2001,2004,2006 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
@@ -286,13 +286,12 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
<linux/socket.h>. */
enum
{
- SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
#define SCM_RIGHTS SCM_RIGHTS
#ifdef __USE_BSD
- SCM_CREDENTIALS = 0x02, /* Credentials passing. */
+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
# define SCM_CREDENTIALS SCM_CREDENTIALS
#endif
- __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
};
/* User visible structure for SCM_CREDENTIALS message */
diff --git a/libc/sysdeps/linux/common/bits/stat.h b/libc/sysdeps/linux/common/bits/stat.h
index 3e8e77f65..0f2000e73 100644
--- a/libc/sysdeps/linux/common/bits/stat.h
+++ b/libc/sysdeps/linux/common/bits/stat.h
@@ -20,9 +20,6 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
-#ifndef _BITS_STAT_H
-#define _BITS_STAT_H
-
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
@@ -35,8 +32,9 @@
#define _MKNOD_VER_SVR4 2
#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+
struct stat
-{
+ {
__dev_t st_dev; /* Device. */
unsigned short int __pad1;
#ifndef __USE_FILE_OFFSET64
@@ -62,23 +60,38 @@ struct stat
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
+#if 0 /*def __USE_MISC*/
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
#ifndef __USE_FILE_OFFSET64
unsigned long int __unused4;
unsigned long int __unused5;
#else
__ino64_t st_ino; /* File serial number. */
#endif
-};
+ };
#ifdef __USE_LARGEFILE64
struct stat64
-{
+ {
__dev_t st_dev; /* Device. */
unsigned int __pad1;
@@ -93,17 +106,28 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+#if 0 /*def __USE_MISC*/
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+#else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
__ino64_t st_ino; /* File serial number. */
-};
+ };
#endif
-
/* Tell code we have these members. */
#define _STATBUF_ST_BLKSIZE
#define _STATBUF_ST_RDEV
@@ -137,6 +161,3 @@ struct stat64
#define __S_IREAD 0400 /* Read by owner. */
#define __S_IWRITE 0200 /* Write by owner. */
#define __S_IEXEC 0100 /* Execute by owner. */
-
-#endif /* _BITS_STAT_H */
-
diff --git a/libc/sysdeps/linux/common/bits/uClibc_local_lim.h b/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
new file mode 100644
index 000000000..34575cb50
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef _BITS_UCLIBC_LOCAL_LIM_H
+#define _BITS_UCLIBC_LOCAL_LIM_H 1
+
+/* This file works correctly only if local_lim.h is the NPTL version */
+#if !defined PTHREAD_KEYS_MAX || defined TIMER_MAX
+# error local_lim.h was incorrectly updated, use the NPTL version from glibc
+#endif
+
+#if defined __UCLIBC_HAS_THREADS__
+# define PTHREAD_THREADS_MAX 16384
+# define TIMER_MAX 256
+#endif
+
+#ifndef __UCLIBC_HAS_THREADS__
+# undef _POSIX_THREAD_KEYS_MAX
+# undef PTHREAD_KEYS_MAX
+# undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_STACK_MIN
+# undef DELAYTIMER_MAX
+#endif
+
+#endif /* bits/uClibc_local_lim.h */
diff --git a/libc/sysdeps/linux/common/bits/waitstatus.h b/libc/sysdeps/linux/common/bits/waitstatus.h
index 982c9dbb2..699c22498 100644
--- a/libc/sysdeps/linux/common/bits/waitstatus.h
+++ b/libc/sysdeps/linux/common/bits/waitstatus.h
@@ -1,5 +1,5 @@
/* Definitions of status bits for `wait' et al.
- Copyright (C) 1992, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1992,1994,1996,1997,2000,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
@@ -38,23 +38,25 @@
#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
/* Nonzero if STATUS indicates termination by a signal. */
-#ifdef __GNUC__
-# define __WIFSIGNALED(status) \
- (__extension__ ({ int __status = (status); \
- !__WIFSTOPPED(__status) && !__WIFEXITED(__status); }))
-#else /* Not GCC. */
-# define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status))
-#endif /* GCC. */
+#define __WIFSIGNALED(status) \
+ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
/* Nonzero if STATUS indicates the child is stopped. */
#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+/* Nonzero if STATUS indicates the child continued after a stop. We only
+ define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
+#endif
+
/* Nonzero if STATUS indicates the child dumped core. */
#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
/* Macros for constructing status values. */
#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#define __W_CONTINUED 0xffff
#define __WCOREFLAG 0x80