errno.h update
Peter S. Mazinger
ps.m at gmx.net
Tue Aug 22 17:03:27 UTC 2006
Hello!
errno.h sync, added uClibc_errno.h used the same way as uClibc_netdb.h
Need to come after errno-syscalls.patch.
After this change #include "bits/syscalls.h" can be changed everywhere to
#include <sys/syscall.h>
Peter
--
Peter S. Mazinger <ps dot m at gmx dot net> ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
-------------- next part --------------
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/alpha/bits/errno.h uClibc/libc/sysdeps/linux/alpha/bits/errno.h
--- uClibc.orig/libc/sysdeps/linux/alpha/bits/errno.h 1970-01-01 01:00:00 +0100
+++ uClibc/libc/sysdeps/linux/alpha/bits/errno.h 2006-05-05 00:55:40 +0200
@@ -0,0 +1,58 @@
+/* Error constants. Linux/Alpha specific version.
+ Copyright (C) 1996,1997,1998,1999,2002,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
+ 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. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
+
+/* Linux has no ENOTSUP error code. */
+# define ENOTSUP EOPNOTSUPP
+
+# ifndef ECANCELED
+# define ECANCELED 131
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 136
+# define ENOTRECOVERABLE 137
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 116 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/common/bits/errno.h uClibc/libc/sysdeps/linux/common/bits/errno.h
--- uClibc.orig/libc/sysdeps/linux/common/bits/errno.h 2006-06-12 17:39:29 +0200
+++ uClibc/libc/sysdeps/linux/common/bits/errno.h 2006-05-05 00:55:41 +0200
@@ -1,5 +1,5 @@
/* Error constants. Linux specific version.
- Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 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
@@ -19,35 +19,41 @@
#ifdef _ERRNO_H
-#include <bits/errno_values.h>
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
-#ifndef ENOTSUP
+/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP
-#endif
-#ifndef ECANCELED
-# define ECANCELED 125
-#endif
-
-#ifndef __ASSEMBLER__
+/* Older Linux versions also had no ECANCELED error code. */
+# ifndef ECANCELED
+# define ECANCELED 125
+# endif
-/* We now need a declaration of the `errno' variable. */
-extern int errno;
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 130
+# define ENOTRECOVERABLE 131
+# endif
+# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable. */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-# if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc )
-libc_hidden_proto(__errno_location)
-/* We wouldn't need a special macro anymore but it is history. */
-# define __set_errno(val) ((errno) = (val))
-# endif /* _LIBC */
-
-# ifdef __UCLIBC_HAS_THREADS__
+# ifdef __UCLIBC_HAS_THREADS__
/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-
-#endif /* !__ASSEMBLER__ */
-
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 84 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/common/bits/uClibc_errno.h uClibc/libc/sysdeps/linux/common/bits/uClibc_errno.h
--- uClibc.orig/libc/sysdeps/linux/common/bits/uClibc_errno.h 1970-01-01 01:00:00 +0100
+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_errno.h 2006-06-07 20:14:04 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#ifndef _BITS_UCLIBC_ERRNO_H
+#define _BITS_UCLIBC_ERRNO_H 1
+
+#ifdef IS_IN_rtld
+# undef errno
+# define errno _dl_errno
+extern int _dl_errno attribute_hidden;
+#elif defined __UCLIBC_HAS_THREADS__
+# include <tls.h>
+# if USE___THREAD
+# undef errno
+# ifndef NOT_IN_libc
+# define errno __libc_errno
+# else
+# define errno errno
+# endif
+extern __thread int errno __attribute_tls_model_ie;
+# endif /* USE___THREAD */
+#endif /* IS_IN_rtld */
+
+#define __set_errno(val) (errno = (val))
+
+#ifndef __ASSEMBLER__
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+# ifdef IS_IN_rtld
+ attribute_hidden
+# endif
+;
+#include <tls.h>
+#if USE___THREAD
+libc_hidden_proto(__errno_location)
+#endif
+
+/* We now need a declaration of the `errno' variable. */
+# ifndef __UCLIBC_HAS_THREADS__
+/*extern int errno;*/
+libc_hidden_proto(errno)
+# endif
+#endif /* !__ASSEMBLER__ */
+
+#endif
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/hppa/bits/errno.h uClibc/libc/sysdeps/linux/hppa/bits/errno.h
--- uClibc.orig/libc/sysdeps/linux/hppa/bits/errno.h 1970-01-01 01:00:00 +0100
+++ uClibc/libc/sysdeps/linux/hppa/bits/errno.h 2006-05-05 00:55:41 +0200
@@ -0,0 +1,51 @@
+/* Error constants. Linux/HPPA specific version.
+ Copyright (C) 1996,1997,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.
+
+ 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. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
+
+/* Linux also has no ECANCELED error code. Since it is not used here
+ we define it to an invalid value. */
+# ifndef ECANCELED
+# define ECANCELED 253
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 47 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/mips/bits/errno.h uClibc/libc/sysdeps/linux/mips/bits/errno.h
--- uClibc.orig/libc/sysdeps/linux/mips/bits/errno.h 1970-01-01 01:00:00 +0100
+++ uClibc/libc/sysdeps/linux/mips/bits/errno.h 2006-05-05 00:55:42 +0200
@@ -0,0 +1,59 @@
+/* Error constants. MIPS/Linux specific version.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 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
+ 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. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
+
+/* Linux has no ENOTSUP error code. */
+# define ENOTSUP EOPNOTSUPP
+
+# ifndef ECANCELED
+# define ECANCELED 158
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 165
+# define ENOTRECOVERABLE 166
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 88 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff -urN --exclude .svn --exclude CVS --exclude .cvsignore --exclude nptl --exclude linuxthreads --exclude linuxthreads.old --exclude linuxthreads.old_db uClibc.orig/libc/sysdeps/linux/sparc/bits/errno.h uClibc/libc/sysdeps/linux/sparc/bits/errno.h
--- uClibc.orig/libc/sysdeps/linux/sparc/bits/errno.h 1970-01-01 01:00:00 +0100
+++ uClibc/libc/sysdeps/linux/sparc/bits/errno.h 2006-05-05 00:55:43 +0200
@@ -0,0 +1,58 @@
+/* Error constants. Linux/Sparc specific version.
+ Copyright (C) 1996,1997,1998,1999,2002,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
+ 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. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
+
+/* Linux has no ENOTSUP error code. */
+# define ENOTSUP EOPNOTSUPP
+
+# ifndef ECANCELED
+# define ECANCELED 127
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 132
+# define ENOTRECOVERABLE 133
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 122 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff -urN --exclude .svn uClibc.orig/include/errno.h uClibc/include/errno.h
--- uClibc.orig/include/errno.h 2006-06-12 17:29:05 +0200
+++ uClibc/include/errno.h 2006-05-05 00:55:40 +0200
@@ -43,30 +43,32 @@
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
-# if defined __USE_GNU && defined __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
+#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;
-# endif /* __USE_GNU */
-# endif /* __ASSEMBLER__ */
+#endif /* __USE_GNU */
#endif /* _ERRNO_H */
__END_DECLS
+#if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc )
+#include <bits/uClibc_errno.h>
+#endif
+
#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
More information about the uClibc
mailing list