OSDN Git Service

microblaze: Remove duplicate F_{S,G}ETPIPE_SZ
[uclinux-h8/uClibc.git] / include / errno.h
index 87edbac..4e3a816 100644 (file)
@@ -12,9 +12,8 @@
    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; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /*
  *     ISO C99 Standard: 7.5 Errors    <errno.h>
@@ -43,30 +42,55 @@ __BEGIN_DECLS
    variable.  This redeclaration using the macro still works, but it
    will be a function declaration without a prototype and may trigger
    a -Wstrict-prototypes warning.  */
-#ifndef __ASSEMBLER__
-# ifndef       errno
+#ifndef        errno
 extern int errno;
-# endif
 #endif
 
+#ifdef _LIBC
+# ifdef __UCLIBC_HAS___PROGNAME__
+extern const char *__progname, *__progname_full;
+# endif
+#endif
 #if defined __USE_GNU && defined __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
 
 /* The full and simple forms of the name with which the program was
    invoked.  These variables are set up automatically at startup based on
    the value of ARGV[0] (this works only if you use GNU ld).  */
-extern char *program_invocation_name, *program_invocation_short_name;
+extern const char *program_invocation_name, *program_invocation_short_name;
 #endif /* __USE_GNU */
 #endif /* _ERRNO_H */
 
 __END_DECLS
 
+#ifdef _LIBC
+#ifdef IS_IN_rtld
+# undef errno
+# define errno _dl_errno
+extern int _dl_errno; /* attribute_hidden */
+#elif defined __UCLIBC_HAS_TLS__
+# if !defined NOT_IN_libc || defined IS_IN_libpthread
+#  undef errno
+#  ifndef NOT_IN_libc
+#   define errno __libc_errno
+#  else
+#   define errno errno             /* For #ifndef errno tests.  */
+#  endif
+extern __thread int errno attribute_tls_model_ie;
+# endif
+#endif
+
+#ifndef __set_errno
+#define __set_errno(val) (errno = (val))
+#endif
+#endif /* _LIBC */
+
 #endif /* _ERRNO_H */
 
 /* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so
    that printing `error_t' values in the debugger shows the names.  We
    might need this definition sometimes even if this file was included
    before.  */
-#if ( defined __USE_GNU || defined __need_error_t ) && !defined __ASSEMBLER__
+#if defined __USE_GNU || defined __need_error_t
 # ifndef __error_t_defined
 typedef int error_t;
 #  define __error_t_defined    1