diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-01-05 01:31:22 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-01-05 01:31:22 +0000 |
| commit | 4c607eb71e5bcd3997ea72333c2fe89fc4181b3e (patch) | |
| tree | 0545e22c5fef9674d15013378bf21eada4017ef2 /include | |
| parent | 43918e1e747e7d52c2d86565721dd66efc5167e5 (diff) | |
| download | uClibc-alpine-4c607eb71e5bcd3997ea72333c2fe89fc4181b3e.tar.bz2 uClibc-alpine-4c607eb71e5bcd3997ea72333c2fe89fc4181b3e.tar.xz | |
And finally, make 'errno' and TLS variable. The TLS conversion of errno, h_errno and __resp was a real challenge. I am glad that is over with.
Diffstat (limited to 'include')
| -rw-r--r-- | include/errno.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/errno.h b/include/errno.h index 203a62e3e..bd363a258 100644 --- a/include/errno.h +++ b/include/errno.h @@ -43,10 +43,8 @@ __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 #if 0 /*def __USE_GNU uClibc note: not supported */ @@ -60,6 +58,24 @@ extern char *program_invocation_name, *program_invocation_short_name; __END_DECLS +#if defined _LIBC && defined __UCLIBC_HAS_THREADS_NATIVE__ +# 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 + +#define __set_errno(val) (errno = (val)) + +#ifndef __ASSEMBLER__ +extern int *__errno_location (void) __THROW __attribute__ ((__const__)); +#endif + #endif /* _ERRNO_H */ /* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so |
