Re: System call v.s. errno

From: Arjan van de Ven
Date: Wed May 04 2005 - 19:46:24 EST


On Wed, 2005-05-04 at 09:22 -0400, Richard B. Johnson wrote:
> Does anybody know for sure if global 'errno' is supposed to

errno is a glibc level thing really, and in recent glibc tehre is no
global errno anymore, only a per thread errno.

> The answer is not obvious because the 'C' runtime library
> doesn't really give access to 'errno' instead it is dereferenced
> off some pointer returned from a function called __errno_location().

yeah to make sure you get the per thread errno instead. Any reasonable
sane code (and all standards conforming code) just deals with that fine.
The case that is known to break is if your app has it's own

extern int errno;

in it, instead of using the proper header to get it.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/