On Thursday 07 July 2005 21:31, Blaisorblade wrote:

> I guess that in NPTL headers, instead of using __errno_location() the
> faster "__thread int errno;" is used; Oleg, can you verify this?

This is excerpt of <bits/errno.h> include file, which is included from 
<errno.h> on Fedora Core 4:

[-- Begin of Excerpt --]
# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable.  */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));

#  if !defined _LIBC || defined _LIBC_REENTRANT
/* When using threads, errno is a per-thread value.  */
#   define errno (*__errno_location ())
#  endif
# endif /* !__ASSEMBLER__ */
[-- End of Excerpt --]

Compiling a test program with "-E" switch shows that preprocessor replaces 
"errno" with "(*__errno_location ())".

There are several definitions of __errno_location() function inside glibc 
sources, but they are inside "#ifdef"s, so I can't tell which of them is 
effective in glibc-2.3.5-10 RPM package used in Fedora Core 4.

-- Oleg Girko, http://www.infoserver.ru/~ol/


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
User-mode-linux-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to