Index: /trunk/src/emx/include/features.h
===================================================================
--- /trunk/src/emx/include/features.h	(revision 2186)
+++ /trunk/src/emx/include/features.h	(revision 2187)
@@ -43,5 +43,6 @@
    _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
 			if >=199309L, add IEEE Std 1003.1b-1993;
-			if >=199506L, add IEEE Std 1003.1c-1995
+			if >=199506L, add IEEE Std 1003.1c-1995;
+			if >=200112L, all of IEEE 1003.1-2004
    _XOPEN_SOURCE	Includes POSIX and XPG things.  Set to 500 if
 			Single Unix conformance is wanted, to 600 for the
@@ -56,4 +57,6 @@
    _REENTRANT		Select additionally reentrant object.
    _THREAD_SAFE		Same as _REENTRANT, often used by other systems.
+   _FORTIFY_SOURCE	If set to numeric value > 0 additional security
+			measures are defined, according to level.
 
    The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
@@ -84,4 +87,5 @@
    __USE_GNU		Define GNU extensions.
    __USE_REENTRANT	Define reentrant/thread-safe *_r functions.
+   __USE_FORTIFY_LEVEL	Additional security measures used, according to level.
    __FAVOR_BSD		Favor 4.3BSD things in cases of conflict.
 
@@ -116,4 +120,5 @@
 #undef	__USE_GNU
 #undef	__USE_REENTRANT
+#undef	__USE_FORTIFY_LEVEL
 #undef	__FAVOR_BSD
 #undef	__KERNEL_STRICT_NAMES
@@ -128,4 +133,18 @@
 /* Always use ISO C things.  */
 #define	__USE_ANSI	1
+
+/* Convenience macros to test the versions of glibc and gcc.
+   Use them like this:
+   #if __GNUC_PREREQ (2,8)
+   ... code requiring gcc 2.8 or later ...
+   #endif
+   Note - they won't work for gcc1 or glibc1, since the _MINOR macros
+   were not defined then.  */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
 
 
@@ -218,4 +237,9 @@
 #endif
 
+
+#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L /* bird: check if defined, -Wundef. */
+# define __USE_XOPEN2K		1
+#endif
+
 #ifdef	_XOPEN_SOURCE
 # define __USE_XOPEN	1
@@ -262,8 +286,6 @@
 # define __USE_BSD	1
 /* bird: __USE_BSD == __BSD_VISIBLE, make sure it's defined. */
-# if 1 /*def __EMX__ */
-#  undef __BSD_VISIBLE
-#  define __BSD_VISIBLE  1
-# endif
+# undef __BSD_VISIBLE
+# define __BSD_VISIBLE  1
 /* bird: end */
 #endif
@@ -283,4 +305,12 @@
 #if defined _REENTRANT || defined _THREAD_SAFE
 # define __USE_REENTRANT	1
+#endif
+
+#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && __GNUC_PREREQ (4, 1) && defined (__OPTIMIZE__) && __OPTIMIZE__ > 0 /* bird: check if defined, -Wundef. */
+# if _FORTIFY_SOURCE == 1
+#  define __USE_FORTIFY_LEVEL 1
+# elif _FORTIFY_SOURCE > 1
+#  define __USE_FORTIFY_LEVEL 2
+# endif
 #endif
 
@@ -305,20 +335,6 @@
    these macros to test for features in specific releases.  */
 #define	__GLIBC__	2
-#define	__GLIBC_MINOR__	3
+#define	__GLIBC_MINOR__	4
 #endif /*bird*/
-
-/* Convenience macros to test the versions of glibc and gcc.
-   Use them like this:
-   #if __GNUC_PREREQ (2,8)
-   ... code requiring gcc 2.8 or later ...
-   #endif
-   Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-   were not defined then.  */
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define __GNUC_PREREQ(maj, min) \
-	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define __GNUC_PREREQ(maj, min) 0
-#endif
 
 #define __GLIBC_PREREQ(maj, min) \
Index: /trunk/src/emx/include/sys/gnu/cdefs.h
===================================================================
--- /trunk/src/emx/include/sys/gnu/cdefs.h	(revision 2186)
+++ /trunk/src/emx/include/sys/gnu/cdefs.h	(revision 2187)
@@ -1,3 +1,3 @@
-/* Copyright (C) 1992-2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2001, 2002, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,5 +18,5 @@
 
 /**
- * GLIBC v2.3.2
+ * GLIBC v2.3.4 CVS
  * @changed bird: #ifndef'ed out a few clashes with the BSD cdefs.h.
  * @changed bird: Workaround for RC & mozilla.
@@ -46,14 +46,19 @@
 /* GCC can always grok prototypes.  For C++ programs we add throw()
    to help it optimize the function calls.  But this works only with
-   gcc 2.8.x and egcs.  */
+   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
+   as non-throwing using a function attribute since programs can use
+   the -fexceptions options for C code as well.  */
+# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
+#  define __THROW	__attribute__ ((__nothrow__))
+#  define __NTH(fct)	__attribute__ ((__nothrow__)) fct
+# else
 # if defined __cplusplus && __GNUC_PREREQ (2,8)
 #  define __THROW	throw ()
+#   define __NTH(fct)	fct throw ()
 # else
 #  define __THROW
-# endif
-# define __P(args)	args __THROW
-/* This macro will be used for functions which might take C++ callback
-   functions.  */
-# define __PMT(args)	args
+#   define __NTH(fct)	fct
+#  endif
+# endif
 
 #else	/* Not GCC.  */
@@ -62,6 +67,5 @@
 
 # define __THROW
-# define __P(args)	args
-# define __PMT(args)	args
+# define __NTH(fct)	fct
 
 # define __const	const
@@ -70,4 +74,9 @@
 
 #endif	/* GCC.  */
+
+/* These two macros are not used in glibc anymore.  They are kept here
+   only because some other projects expect the macros to be defined.  */
+#define __P(args)	args
+#define __PMT(args)	args
 
 /* For these things, GCC behaves the ANSI way normally,
@@ -129,4 +138,10 @@
 
 
+/* Fortify support.  */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+#define __warndecl(name, msg) extern void name (void)
+
+
 /* Support for flexible arrays.  */
 #if __GNUC_PREREQ (2,97)
@@ -160,4 +175,11 @@
 
 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+#  define __REDIRECT_NTH(name, proto, alias) \
+     name proto __THROW __asm__ (__ASMNAME (#alias))
+# else
+#  define __REDIRECT_NTH(name, proto, alias) \
+     name proto __asm__ (__ASMNAME (#alias)) __THROW
+# endif
 # define __ASMNAME(cname)  __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
 # define __ASMNAME2(prefix, cname) __STRING (prefix) cname
@@ -237,4 +259,36 @@
 #endif
 
+/* The nonull function attribute allows to mark pointer parameters which
+   must not be NULL.  */
+#if __GNUC_PREREQ (3,3)
+# define __nonnull_glibc(params) __attribute__ ((__nonnull__ params))
+#else
+# define __nonnull_glibc(params)
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+   function calls which can lead to problems.  */
+#if __GNUC_PREREQ (3,4)
+# define __attribute_warn_unused_result__ \
+   __attribute__ ((__warn_unused_result__))
+# if __USE_FORTIFY_LEVEL > 0
+#  define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined.  */
+#ifndef __always_inline /* bird */
+#if __GNUC_PREREQ (3,2)
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# define __always_inline __inline
+#endif
+#endif                  /* bird */
+
 /* It is possible to compile containing GCC extensions even if GCC is
    run in pedantic mode if the uses are carefully marked using the
