Back to index

glibc  2.9
errno.h
Go to the documentation of this file.
00001 #ifndef _ERRNO_H
00002 
00003 #include <stdlib/errno.h>
00004 
00005 #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus
00006 
00007 # ifdef IS_IN_rtld
00008 #  include <dl-sysdep.h>
00009 # endif
00010 
00011 # if RTLD_PRIVATE_ERRNO
00012 /* The dynamic linker uses its own private errno variable.
00013    All access to errno inside the dynamic linker is serialized,
00014    so a single (hidden) global variable is all it needs.  */
00015 
00016 #  undef  errno
00017 #  define errno rtld_errno
00018 extern int rtld_errno attribute_hidden;
00019 
00020 # else
00021 
00022 #  include <tls.h>
00023 
00024 #  if USE___THREAD
00025 #   undef  errno
00026 #   ifndef NOT_IN_libc
00027 #    define errno __libc_errno
00028 #   else
00029 #    define errno errno            /* For #ifndef errno tests.  */
00030 #   endif
00031 extern __thread int errno attribute_tls_model_ie;
00032 #  endif
00033 
00034 # endif       /* RTLD_PRIVATE_ERRNO */
00035 
00036 # define __set_errno(val) (errno = (val))
00037 
00038 # ifndef __ASSEMBLER__
00039 extern int *__errno_location (void) __THROW __attribute__ ((__const__))
00040 #  if RTLD_PRIVATE_ERRNO
00041      attribute_hidden
00042 #  endif
00043 ;
00044 libc_hidden_proto (__errno_location)
00045 # endif
00046 
00047 #endif /* _ERRNO_H */
00048 
00049 #endif /* ! _ERRNO_H */